An AuthorizationFilter that sets a ViewResult when the user is not authorized.
Initializes a new instance of AuthMvcRoleRequirementFilter.
public Void AuthMvcRoleRequirementFilter(auth, requiredRoles, roleProvider)
Name | Type | Summary |
---|---|---|
auth | AuthMvcAttribute | The AuthMvcAttribute that initializes this filter. |
requiredRoles | String[] | A collection of roles required to access the controller of action. |
roleProvider | IRoleProvider | An IRoleProvider that provides application Roles. |
The AuthMvcAttribute that initializes this filter.
public AuthMvcAttribute AuthMvc { get; }
The name of the view to return if the user is not authorized.
public String ForbiddenViewName { get; }
A collection of roles required to access the controller or action.
public String[] RequiredRoles { get; set; }
An IRoleProvider that provides application Roles.
public IRoleProvider RoleProvider { get; }
Process the authorization logic.
public Void OnAuthorization(context)
Name | Type | Summary |
---|---|---|
context | AuthorizationFilterContext | Am AuthorizationFilterContext. |
In this document