Another Security Question...

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


From: "Chris Blanco" <cblancoNOSPAM@necam.com>
Date: Tue, 25 Mar 2003 14:24:01 -0500


First off let me say that this has been the most helpful ASP.NET newsgroup
that I have found, thanks for all the good answers.

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

  • Custom Permissions
    ... Does anyone have any information on creating custom permissions and ... 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] ...
    (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)
  • Re: Design Question
    ... reasonably simple to swap out the principal for a web service, ... > the declaration of the PrincipalPermission attribute and the call to ... Implement the check as a custom permission with a corresponding ... This might interfere with your planned object ...
    (microsoft.public.dotnet.languages.csharp)