A @Policy class
One of its ability methods
Optionaltarget: PolicyTarget<PolicyClassTarget<C, K>>
A fixed target, or an extractor called per request
A standard method decorator
Requires an ability of a definePolicy definition on a route.
A policy definition
One of its ability names
Optionaltarget: PolicyTarget<T>
A fixed target, or an extractor called per request
A standard method decorator
Requires a policy ability on a route.
Refused at
register()when no authorization policy service is registered (registerAuthPlugin), or when the policy or ability is not registered. Per request:401when the ability denies an anonymous request,403when it denies a signed-in principal, otherwise the route continues. Repeatable: every@RequirePolicyon a route must allow, evaluated top to bottom. Runs after guards and@Roles/@Permissions, and before interceptors, middleware and validation — so a target extractor reading the body sees the UNVALIDATED body; prefer route parameters.