Class NavigationAuthorizeAttribute
Authorization attribute that verifies whether the current user is allowed to access
the navigation node identified by the nav query parameter (or the legacy inav parameter).
When authorization fails, the response is either an HTTP status code or a redirect to the access-denied page,
depending on the configured NavigationAuthorizeAttribute.ResponseMode.
Inherited Members
Namespace: DataWeb.Filter
Assembly: DataWeb.Core.dll
Syntax
public sealed class NavigationAuthorizeAttribute : TypeFilterAttribute, IFilterFactory, IOrderedFilter, IFilterMetadata
Remarks
On success, the resolved Navigation and its NavigationContext are stored
in Items under the keys "Navigation"
and "NavigationContext" for use by the action.
Constructors
NavigationAuthorizeAttribute(ResponseMode, ResponseErrorCode)
Initializes a new instance of the NavigationAuthorizeAttribute class.
Declaration
public NavigationAuthorizeAttribute(NavigationAuthorizeAttribute.ResponseMode responseMode = ResponseMode.StatusCode, NavigationAuthorizeAttribute.ResponseErrorCode responseErrorCode = ResponseErrorCode.Forbidden)
Parameters
| Type | Name | Description |
|---|---|---|
| NavigationAuthorizeAttribute.ResponseMode | responseMode | Determines whether a failed authorization returns an HTTP status code or redirects to the access-denied page. Defaults to StatusCode. |
| NavigationAuthorizeAttribute.ResponseErrorCode | responseErrorCode | The HTTP error code to return when StatusCode is active.
Defaults to Forbidden ( |