Web Part referencing other assemblies throws security exception

From: al-baghdadi (a.d._at_nospam.nospam)
Date: 10/14/04


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.


Relevant Pages

  • Re: System.Security.Principal.WindowsImpersonation
    ... MessageBox.Show("The user is a member of ... something with impersonation that wasn't allowed. ... >> WindowsIdentity class to ... >> dwFlags As Integer, ByRef ...
    (microsoft.public.dotnet.security)
  • RE: check if user belong to a domain against active directory without
    ... "Any one who has never made a mistake has never tried anything new" - Einstein ... > I just get stuck on how to check if a user is a member of network. ... > is a member of the domain account against Global Catalog. ... Changing WindonIdentity with impersonation at run time is ...
    (microsoft.public.dotnet.framework.aspnet)
  • check if user belong to a domain against active directory without impersonation
    ... I just get stuck on how to check if a user is a member of network. ... I am building an internal tracking system with ASP.Net with Form ... Changing WindonIdentity with impersonation at run time is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Identity Impersonation question.
    ... individual webs (I know you mentioned you dont want to allow singular webs ... If the users are not a member of a domain, then setup ... all I need to do then is to find a way to prevent impersonation ...
    (microsoft.public.dotnet.framework.aspnet)

Quantcast