Custom Assembly security problem from Reporting Services

From: Flon (Flon_at_discussions.microsoft.com)
Date: 02/15/05


Date: Tue, 15 Feb 2005 06:55:02 -0800

This message has also been posted in the ReportingSvcs group.

I have created a custom assembly that contains a function that uses
System.DirectoryServices to determine the user groups a user belongs to. It
works fine in development (preview) but returns the following error on the
report server:

"Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 failed."

- I have another function in the same assembly that uses
System.Data.SQLClient to access a database and return values - this works
fine.

- I have included a codegroup for the assembly in rssrvpolicy.config with
the FullTrust permissionset.

- I have tried combinations of the following in the assemblyInfo.cs file:
[assembly: DirectoryServicesPermission(SecurityAction.RequestMinimum,
PermissionAccess=DirectoryServicesPermissionAccess.Browse)]
[assembly:
System.Security.Permissions.SecurityPermission(SecurityAction.RequestMinimum,
Unrestricted = true)]
[assembly: AllowPartiallyTrustedCallers]

- I have tried the following at the top of the function:
System.DirectoryServices.DirectoryServicesPermission pDir = new
DirectoryServicesPermission(System.Security.Permissions.PermissionState.Unrestricted);
System.DirectoryServices.DirectoryServicesPermissionEntry pDirEnt = new
DirectoryServicesPermissionEntry(System.DirectoryServices.DirectoryServicesPermissionAccess.Browse,"");
pDir.PermissionEntries.Add(pDirEnt);
pDir.Assert();

Please help!
I have been trying to solve this for ages and just cannot find a solution.

Regards,
Flon Mackenzie


Loading