Re: Custom Principal Permission

From: Eugene V. Bobukh [MS] (eugenebo_at_online.microsoft.com)
Date: 06/26/03


Date: Thu, 26 Jun 2003 11:10:44 -0700


Not to say that I know the answer... But I have couple of hints/questions.

First, that declarative attribute has a method called CreatePermission. Is
it called when you build assemblies that use this attribute [easy to check
by injecting something like Console.WriteLine(..) into it].

Second, did you implement attribute in the same file where permission class
is implemented? If yes, then probably you'd better keep them separated,
although I don't remember exactly what problems single file solution
presents.

Third, does everything work if you add your permission and attribute
assemblies to the GAC and Policy Assembly list? [I suspect MSDN might be
just wrong here...]

-- 
Eugene V. Bobukh
This message is provided "AS IS" with no warranties, and confers no rights.
Any opinions or policies stated within it are my own and do not necessarily
constitute those of my employer.
----
"Olivier Haddad" <olivier.hadad@emblaze.com> wrote in message
news:ukcnvHwODHA.3020@TK2MSFTNGP10.phx.gbl...
> I wrote a simple class implementing IPermission and a corresponding
> attribute class deriving from SecurityAttribute.
>
> My permission class does not derive from CodeAccessPermission as I am not
> interested in a stack walk (like PrincipalPermission).
>
> I didn't add the assembly to the Security Policy as MSDN states that it is
> not needed for non-CAS permissions.
>
> Imperative permission works fine, but declarative permission is ignored.
> Checking the compiled file with ILDasm and Permview revealed that no XML
> permission metadata was added.
>
> How do I get my Security Attribute derivated class to work?
>
> The MSDN documentation only gives proper examples for CodeAccessSecurity
> derived classes.
>
>


Relevant Pages

  • Re: security/strong name/zones clarification needed
    ... Does the Assert code go in its ... >>this AppDomain needs to be setup before your assembly can ... >>will recieve the permission grant you expect (in this ... All my assemblies are strong named. ...
    (microsoft.public.dotnet.security)
  • Re: assembly doesn permit partially trustets calls
    ... To mitigate the risk, think very carefully about the permissions that you assign to the application running on the file share so that it permits exactly and only the request to satisfy the permission demand, block everything else. ... we can give all the assemblies in the ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework)
  • Re: security/strong name/zones clarification needed
    ... Does the Assert code go in its ... >this AppDomain needs to be setup before your assembly can ... >will recieve the permission grant you expect (in this ... All my assemblies are strong named. ...
    (microsoft.public.dotnet.security)
  • Re: security/strong name/zones clarification needed
    ... Dim zz As New System.Security.PermissionSet ... >> When assemblies are ... >>>needs to host the CLR, it creates an AppDomain, but due ... >>>will recieve the permission grant you expect (in this ...
    (microsoft.public.dotnet.security)
  • Re: Windows Control Hosted in IE Problem
    ... 'Internet Explorer Security and Managed Execution' MSDN article ... How Internet Explorer Determines Permissions for .NET Framework Assemblies' ... Create a permission set and a Custom Code Group in .NET ...
    (microsoft.public.dotnet.framework)

Quantcast