Re: Help on Creating a Custom Permission
From: Doug Bahr (dbahr_at_hotmail.com)
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
because it does not state that the CustomPermissionSecurityAttribute must be
from the CodeAccessSecurityAttribute to have the compiler find and work with
Thanks for your help.
"Pieter Philippaerts" <Pieter@nospam.mentalis.org> wrote in message
> "Doug Bahr" <firstname.lastname@example.org> 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
> > 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.
> Pieter Philippaerts
> Managed SSL/TLS: http://www.mentalis.org/go.php?sl