Web Part referencing other assemblies throws security exception
From: al-baghdadi (a.d._at_nospam.nospam)
Date: 10/14/04
- Next message: Joel Martinez: "Re: Download files from Sharepoint v1 using vb6"
- Previous message: J. Shane Kunkle: "Accessing data in a separate database"
- Next in thread: Wei-Dong XU [MSFT]: "RE: Web Part referencing other assemblies throws security exception"
- Reply: Wei-Dong XU [MSFT]: "RE: Web Part referencing other assemblies throws security exception"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 14 Oct 2004 07:57:05 -0700
Hi,
I have a Web Part that references another assembly. In that assembly, I have
a class that retrieves info from the WinNt provider (return groups I am a
member of, who are the members of this group on that server etc.). The way I
do this is by letting the code impersonate the current user (to ensure you
get what you have access to only).
It seems the impersonation code doesn't event run, and a security exception
is thrown. From my reading, I understand that SharePoint uses CAS, and the
call stack is checked at run-time to see if a caller has enough permissions,
and therefore the security exception is thrown even before the code gets to
execute.
I don't want to add that assembly to the GAC. And I certainly don't prefer
writing a custom policy config as I may be having the same problem in the
future, and I definitely don't want the assembly to have full-trust.
My question is, how can I allow this impersonation to take place?
I would greatly appreciate your help.
-- I do it for a living, but you live with what I do.
- Next message: Joel Martinez: "Re: Download files from Sharepoint v1 using vb6"
- Previous message: J. Shane Kunkle: "Accessing data in a separate database"
- Next in thread: Wei-Dong XU [MSFT]: "RE: Web Part referencing other assemblies throws security exception"
- Reply: Wei-Dong XU [MSFT]: "RE: Web Part referencing other assemblies throws security exception"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|