Running SSRS 2005, I have a custom assembly that needs to read/browse
the file system, Active Directory, and the registry. I have added the
explicit permissions into the code before the calls ie.
Dim fsec As New FileIOPermission(FileIOPermissionAccess.AllAccess,
strFilePath)
fsec.Assert()
Dim perm As New RegistryPermission(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\SOFTWARE\0")
perm.Assert()
Dim dsp As New
DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse,
groupLDAP)
dsp.Assert()
I believe I've added the code group entry for my assembly into the
rssrvpolicy.config file in the correct place (first entry in the group
for the zone=MyComputer.)
<CodeGroup class="FirstMatchCodeGroup"
version="1" PermissionSetName="FullTrust"
Name="MyCustomAssemblyCodeGroup"
Description="A special code group for my custom assembly">
<IMembershipCondition class="UrlMembershipCondition" version="1"
Url="D:\Microsoft SQL Server 2005\MSSQL.3\Reporting Services
\ReportServer\bin\UrixRS.dll"/>
</CodeGroup>
The report runs fine in preview (expected), in debugLocal (great), but
returns errors when it is deployed to the server (rats!) Actually, the
file IO runs OK on the server. It's just the LDAP and registry calls
that die. Some other code that does not use protected resources runs
fine so I'm confident that I brought the assembly into the report
correctly.
I've disabled the CAS security and the report still errors on the
server. I also made sure the web.config file has impersonate="true" so
the machine user_id should be passed (The global User!UserID in RS is
showing correctly on the server report). Anyone have any ideas what
the issue may be?Update. I've gotten the registry access to work. The problem I still
have is that I can't access the LDAP. I believe the root of the
problem has to do with I'm not able to use UNC paths in my assembly or
I get a not found error. It can access c:\myfile.txt fine, but it
can't get to \\myserver\myfile.txt.
As before, everything still works fine locally, it's just when I try
to run off the report server that I have the problem.
Has anyone had similar issues using UNC paths in custom assemblies?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment