Custom Permissions

From: Chris Blanco (cblancoNOSPAM@necam.com)
Date: 03/31/03


From: "Chris Blanco" <cblancoNOSPAM@necam.com>
Date: Mon, 31 Mar 2003 09:25:58 -0500


Does anyone have any information on creating custom permissions and
permission attributes other than the MSDN articles. Information on this
topic is Sparse to say the least.

Here is a quick summary of what I wish to accomplish:

I am developing a custom Principal and Identity for a large Application. It
is going to be used to drill a little further down than roles, so that I can
limit parts of my code to certain access rights (In my design, roles are
made up from a bunch of rights. The rights are defined by me, but can be
moved and deleted from role to role by the end user, so I need something
very flexible). My custom Identity holds all the specific access rights and
roles a user has, so I will be able to check the Threads current principal
to find an access right. I have the Principal and Identity up and running,
but I am having trouble developing an attribute similar to [SecurityRole] or
[PrincipalPermission] that will take an access right instead of a Role.

For example I would like to do something like this.

[NeedsRight("SFCEdit")]
bool ChangeSFC(string strSFc)
{...}

Where if the user does not have the right specified by NeedsRight I will be
able to prevent him from entering that function. How does this work? I know
how to write a custom attribute I just don't know how to prevent the user
from entering that code block. Any pointing in the right direction would be
appreciated greatly!



Relevant Pages

  • Another Security Question...
    ... I am developing a custom Principal and Identity for a large Application. ... limit parts of my code to certain access rights (In my design, ... [PrincipalPermission] ... able to prevent him from entering that function. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Design Question
    ... and let Code Access Security take care of the rest. ... the declaration of the PrincipalPermission attribute and the call to ... Implement the check as a custom permission with a corresponding> attribute ... >> way of doing it is to call this AccessCheck on top of each public method,>> I want to implement it in different way but seems missing something ->> ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Control Access Rights
    ... Joe Richards Microsoft MVP Windows Server Directory Services ... Access Rights) in ADAM. ... I've walked through the procedure of creating a custom right and granting a user that right on an AD container. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Design Question
    ... >> the declaration of the PrincipalPermission attribute and the call to ... Implement the check as a custom permission with a corresponding ... If I want to check permission on each public method of a web service, ...
    (microsoft.public.dotnet.languages.csharp)
  • Group properies help..
    ... How can you define a group access rights. ... developer and I want to custom define thier acces rights to the system. ... do you find the detailed access rights information on any group. ...
    (microsoft.public.windowsxp.security_admin)