Re: Help on Creating a Custom Permission

From: Doug Bahr (dbahr_at_hotmail.com)
Date: 10/27/03


Date: Mon, 27 Oct 2003 14:02:38 -0500

Thank you for you reply.
It is the first bit of news that I have found that explains why the custom
attribute does NOT
get called declaratively.

I guess that the documentation on "Adding Declarative Security Support" is
then incomplete
because it does not state that the CustomPermissionSecurityAttribute must be
derived
from the CodeAccessSecurityAttribute to have the compiler find and work with
it.

Thanks for your help.

Doug.

"Pieter Philippaerts" <Pieter@nospam.mentalis.org> wrote in message
news:e23pOOpmDHA.744@tk2msftngp13.phx.gbl...
> "Doug Bahr" <dbahr@hotmail.com> wrote in message
> > Does anyone have any advice on how to create my own Custom Permission?
> > I do NOT want a stack walk when the permission demand is invoked so I
> think
> > that I should not derive the custom permission from the Code Access
> > Permission.
>
> Here's a comment I found in Microsoft's SSCLI source code: "Note:
> PrincipalPermissionAttribute currently derives from
> CodeAccessSecurityAttribute, even though it's not related to code access
> security. This is because compilers are currently looking for
> CodeAccessSecurityAttribute as a direct parent class rather than
> SecurityAttribute as the root class."
>
> So I'm afraid you're out of luck and that you should inherit from the
> CodeAccessSecurityAttribute class. This may be fixed in future versions of
> the framework.
>
> Regards,
> Pieter Philippaerts
> Managed SSL/TLS: http://www.mentalis.org/go.php?sl
>
>



Relevant Pages

  • 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: Custom Security Permission & Security Attribute troubles
    ... >> I'm trying to write a library that will allow me to add a custom ... >> permission for my applications (let's call it ApplicationPermission ... and a custom security attribute to support declarative ... >> CodeAccessSecurityAttribute ...
    (microsoft.public.dotnet.security)
  • Jtable cell navigation problem
    ... I hava a jtable with custom controls and there are two kinds of custom ... One is derived from jtextfield and the other one derives ... After that i've tried to capture the tab key in the text field on ...
    (comp.lang.java.gui)
  • Re: Culture neutral Description Attribute?
    ... > I have added a few custom Description Attributes to an assembly. ... It doesn't break it at all, as DescriptionAttribute derives from ... required culture. ... If replying to the group, please do not mail me too ...
    (microsoft.public.dotnet.languages.csharp)