Skip to main content

resource_auth_middleware

Function resource_auth_middleware 

Source
pub fn resource_auth_middleware(
    policy: Arc<dyn IAuthorizationPolicy>,
) -> impl IMiddleware
Expand description

Create a resource-based authorization middleware.

Register this middleware AFTER the authentication middleware in the pipeline. The middleware reads the route pattern (set by the router) and claims (set by the auth middleware) to enforce the policy.