Interface IAuthorizationMetadataService
- Namespace
 - Htmx.Components.Services
 
- Assembly
 - Htmx.Components.dll
 
Provides services for extracting and evaluating authorization metadata from controller actions.
public interface IAuthorizationMetadataService
  - Extension Methods
 
Remarks
This service caches authorization metadata and authorization results to improve performance when checking user permissions for controller actions repeatedly.
Methods
GetMetadataAsync(ControllerActionDescriptor)
Extracts authorization metadata from a controller action descriptor.
Task<AuthorizationMetadata> GetMetadataAsync(ControllerActionDescriptor descriptor)
  Parameters
descriptorControllerActionDescriptorThe controller action descriptor to analyze.
Returns
- Task<AuthorizationMetadata>
 A task that represents the asynchronous operation. The task result contains the authorization metadata.
IsAuthorizedAsync(ControllerActionDescriptor, ClaimsPrincipal)
Determines whether the specified user is authorized to access the controller action.
Task<bool> IsAuthorizedAsync(ControllerActionDescriptor descriptor, ClaimsPrincipal user)
  Parameters
descriptorControllerActionDescriptorThe controller action descriptor to check authorization for.
userClaimsPrincipalThe claims principal representing the user.