Custom CAS permission...



Hi there,

I've created a custom CAS permission in my .NET 2.0 application, but I'm
having some problems to get it to work properly.
I've based the design of my code on the article at
http://msdn2.microsoft.com/en-us/library/yctbsyf4(VS.80).aspx Everything
seems to be in order and pretty much the same as in the article. I've
compiled the code, installed it in the GAC and adjusted the CAS policy to
give my permission to the Local Intranet zone. Up until now, everything
seems to work properly.
However, when I run a partially trusted application (from a shared intranet
drive) that calls into the library and requires my custom permission, the
demand always fails. The IsSubsetOf method is called once during the demand,
but the target parameter is always a null reference.

Does anyone know why this could be happing? I'd assume that this happens
because my custom permission wasn't granted to the application, however when
I use the "Evaluate Assembly..." option from the Runtime Security Policy
tool, I see that my permission should indeed be granted to the application.

Thanks,
Pieter


.



Relevant Pages

  • Re: Roles and Permissions??
    ... use our custom permission. ... your other problem and actually get the custom permission to work ... > and PrincipalPermission were designed to do. ... > CodeAccessPermissionAttribute? ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Custom Security Permission & Security Attribute troubles
    ... the permission and attribute in the "policy assemblies" list by using mscorcfg.msc ... > I'm trying to write a library that will allow me to add a custom ... > permission for my applications (let's call it ApplicationPermission ... > CodeAccessSecurityAttribute ...
    (microsoft.public.dotnet.security)
  • Re: Manually set custom permissions based on User
    ... I need to define the code access policy per user role outside my source code ... > There is a permission you can demand called PrincipalPermission that can ... > also just call the IsInRole method on the custom IPrincipal to do the same ... the permission required to call the Calculator ...
    (microsoft.public.dotnet.security)
  • Re: Problem with Event Log (long)
    ... I know that it can write to the custom event log but, unfortunately, this is ... ASP.NET process the right to read the Security account then everything ... doesn't have read permission for *all* of the event logs. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Design Question
    ... Implement the check as a custom permission with a corresponding ... > way of doing it is to call this AccessCheck on top of each public method, ... > base class for all web service classes, Is there any way to capture the ...
    (microsoft.public.dotnet.languages.csharp)