Class NavigationAuthorizeAttribute.NavigationAuthorizeFilter
Authorization filter created by NavigationAuthorizeAttribute via TypeFilterAttribute.
Resolves the navigation node from the nav query parameter and delegates permission
checking to GetNavigationContextAsync(Navigation, IUser, CancellationToken).
Inherited Members
Namespace: DataWeb.Filter
Assembly: DataWeb.Core.dll
Syntax
public class NavigationAuthorizeAttribute.NavigationAuthorizeFilter : IAsyncAuthorizationFilter, IFilterMetadata
Constructors
NavigationAuthorizeFilter(ResponseMode, ResponseErrorCode, IUser, INavigationService)
Authorization filter created by NavigationAuthorizeAttribute via TypeFilterAttribute.
Resolves the navigation node from the nav query parameter and delegates permission
checking to GetNavigationContextAsync(Navigation, IUser, CancellationToken).
Declaration
public NavigationAuthorizeFilter(NavigationAuthorizeAttribute.ResponseMode responseMode, NavigationAuthorizeAttribute.ResponseErrorCode responseErrorCode, IUser user, INavigationService navigationService)
Parameters
| Type | Name | Description |
|---|---|---|
| NavigationAuthorizeAttribute.ResponseMode | responseMode | How to respond when authorization fails. |
| NavigationAuthorizeAttribute.ResponseErrorCode | responseErrorCode | The HTTP error code to use when StatusCode is active. |
| IUser | user | The current user, injected by the DI container. |
| INavigationService | navigationService | The navigation service used to evaluate permissions, injected by the DI container. |
Methods
OnAuthorizationAsync(AuthorizationFilterContext)
Evaluates authorization for the current request.
Reads the nav query parameter (falling back to legacy inav), deserializes
the Navigation, and checks visibility via GetNavigationContextAsync(Navigation, IUser, CancellationToken).
Aborts the pipeline if the parameter is missing or the navigation is not visible for the current user.
On success, stores the resolved Navigation and NavigationContext in
Items for downstream use.
Declaration
public Task OnAuthorizationAsync(AuthorizationFilterContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| AuthorizationFilterContext | context | The AuthorizationFilterContext for the current request. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |