call database from within method attribute for declarative security?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hazz

    call database from within method attribute for declarative security?

    I would like to have an attribute stand as a gatekeeper to a method.
    What I don't want to do is hard code a user's role into the attribute as
    follows.
    [PrincipalPermis sion(SecurityAc tion.Demand, Role = "PartiallyTrust ed")]
    public void DoSomething(){
    //only users with a "PartiallyTrust ed" role can access this method.
    }

    Is it possible to make a database call from the attribute to obtain the
    role, perhaps passing the username to a stored procedure which the Identity
    obtained from the thread ?

    Thank you,
    -Greg


Working...