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
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