Re: Using declaritive security on class members

From: Michael Giagnocavo [MVP] (mggUNSPAM_at_Atrevido.net)
Date: 07/21/03


Date: Mon, 21 Jul 2003 11:12:14 -0600


Have you tried with Role = @"BUILTIN\Administrators" ?
-mike
MVP

"Jason Kleban" <jason.kleban@bdhhi.com> wrote in message
news:01ad01c34fa2$60e60750$a101280a@phx.gbl...
> I'm trying to require that the user account calling
> certain member functions belongs to an admin role.
>
> I've tried several variations on the following, but I get
> denied every time. I need something in the form of the
> first, yet I tried others just to get any positive results
> (but got none). I can't say I've tried every combo, but
> I'm thinking more is wrong with what I'm doing than just
> the strings I'm giving it.
>
> [PrincipalPermissionAttribute(SecurityAction.Demand, Role
> = @"myDomain\Administrators")]
> public void selfDestruct(){ ... }
>
> [PrincipalPermissionAttribute(SecurityAction.Demand, Name
> = "myUser")]
>
> [PrincipalPermissionAttribute(SecurityAction.Demand, Name
> = @"myDomain\myUser")]
>
> [PrincipalPermissionAttribute(SecurityAction.Demand, Name
> = @"myComputer\myUser")]
>
> [PrincipalPermissionAttribute(SecurityAction.Demand, Name
> = "", Role = "Administrators")]
>
> [PrincipalPermissionAttribute(SecurityAction.Demand, Name
> = null, Role = "Administrators")]
>
> [PrincipalPermissionAttribute(SecurityAction.Demand, Name
> = null, Role = @"myDomain\Administrators")]
>
> and so on.
>
> Any help?
>
> Thanks,
>
> Jason


Quantcast