all groups > sql server reporting services > december 2005 >
You're in the

sql server reporting services

group:

System.Security.Permissions.SecurityPermission


System.Security.Permissions.SecurityPermission Jedi Punk
12/9/2005 10:40:50 AM
sql server reporting services:
Before I go any further, let me admit I have searched all over for the
fix and nothing is working.

Here is my Error
The hidden expression for the table 'table1' contains an error:
Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed. (rsProcessingError) Get Online Help

Here is my goal.
I have a report that has restricted access to 5 nt groups.
This same report must restrict viewing so that one group cannot view
another groups data.
I want to do this with one report and not 5 copies of the same report.
The groups choose their view from a dropdown.
I have Report Code that confirms the user is in the group and if not
the report table's visibility is hidden. (They actual group value comes
from the 1st record of the returned dataset rather than the dropdown).

My report code works in VS2003. However it does not work when I deploy
to my local report service GUI nor to my production box.

Here is the report code.
------BEGIN CODE ------
Function IsInRole(ByVal roleName as string) as Boolean
DIM myPrincipal as System.Security.Principal.WindowsPrincipal =
New
System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent())
DIM bInRole as boolean
bInRole = myPrincipal.IsInRole(roleName)
return bInRole
End Function
------END CODE ------


Here is what I have tried to do to fix this.
I have edited RSReportServer.config and added...
<CustomAssemblies>
<Default>
<PermissionSet class="System.Security.PermissionSet">
<IPermission
class="System.Security.Permissions.SecurityPermission"
version="1"
Flags="Execution"
/>
</PermissionSet>
</Default>
</CustomAssemblies>

I have edited in rssrvpolicy.config the lines...
<IPermission
class="SecurityPermission"
version="1"
Flags="Execution"
/>
**changed Execution to Full and FullTrust

I have tried adding above my function in report code...
<PermissionSet(SecurityAction.Assert, Unrestricted:=True)> _
(This would not compile)


I have tried all these and in combination. Nothing has helped.
I am not married to this methodology and would be willing to try other
ideas if my current approach is not feasible. However, since it is
working in VS I must have something setup wrong somewhere on RS. The
files are in default form, now.

Thank you.
Re: System.Security.Permissions.SecurityPermission Jedi Punk
12/9/2005 10:44:15 AM
Forgot to mention that I also tried adding a reference to
System.Security to no avail.
RE: System.Security.Permissions.SecurityPermission Carmine
1/12/2006 1:22:02 PM
I was having issues with getting deployed reports to work when run via the
web. Eventually, we just created a DLL that didn't have a Strong Name, and
that solved the problem. You don't need to put the <CustomAssemblies> tag in
any config files, all you have to do is put the DLL in the correct folder on
the server.

[quoted text, click to view]
AddThis Social Bookmark Button