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.