[This is preliminary documentation and subject to change.]
Determines if the given principal is member of the given role.
true if the principal is member of the role; false otherwise.
The implementation simply invokes the role.IsMember(principal)
method.
The following is an example of an overriden IsRoleMember method. The example simply returns false from the method thus making the authorization policy refuse to execute action regardless of the CurrentPrincipal role membership:
[Visual Basic]
Private Class NoOpAuthorizationPolicy
Inherits AuthorizationPolicy
Protected Overrides Function IsRoleMember(ByVal principal As IPrincipal, ByVal role As Role) As Boolean
Return False
End Function
End Class
[C#]
private class NoOpAuthorizationPolicy : AuthorizationPolicy
{
protected override bool IsRoleMember(IPrincipal principal, Role role)
{
return false;
}
}
AuthorizationPolicy Class | LaMarvin.Constable Namespace