pub struct AuthorizerSet { /* private fields */ }Expand description
A set of IDynamicAuthorizer instances collected from the DI container.
Created automatically in HostBuilder::build() when one or more
IDynamicAuthorizer implementations are registered. If none are registered,
this is None and no dynamic authorization checks run.
Implementations§
Source§impl AuthorizerSet
impl AuthorizerSet
Sourcepub fn new(authorizers: Vec<Arc<dyn IDynamicAuthorizer>>) -> Self
pub fn new(authorizers: Vec<Arc<dyn IDynamicAuthorizer>>) -> Self
Create a new set from a vector of authorizers.
Run all registered authorizers in sequence.
Returns Ok(()) if ALL authorizers pass. Returns the first Err if any denies.
1.1 compatibility — new code should call
AuthorizerSet::authorize_with_rules instead, which passes the
endpoint’s declared rules. This method is equivalent to that call with an
empty declaration.
Run all registered authorizers in sequence, handing them the matched
endpoint’s #[authorize] declaration.
Returns Ok(()) if ALL authorizers pass. Returns the first Err if any denies.