Skip to main content

require_role

Attribute Macro require_role 

Source
#[require_role]
Expand description

Require a role — auto-injects auth.require_role("ROLE")?; at the start of the handler. The handler must have an AuthGuard parameter. Usage: #[require_role("ROLE_ADMIN")]