pub struct RoleAuthorizer { /* private fields */ }Expand description
First-match role authorizer, and the coqui_roles provider, configured with a
RolePolicy.
Implementations§
Source§impl RoleAuthorizer
impl RoleAuthorizer
Sourcepub fn builder() -> RoleAuthorizerBuilder
pub fn builder() -> RoleAuthorizerBuilder
Starts a policy in code; add roles and rules, then build.
Sourcepub fn new(policy: RolePolicy) -> Result<Self, RolePolicyError>
pub fn new(policy: RolePolicy) -> Result<Self, RolePolicyError>
Checks policy and compiles it.
§Errors
Returns an error for unknown roles, duplicate role names or actions, malformed
subjects or scopes, a scope kind that is not allowed, or a policy past its
RoleLimits.
Trait Implementations§
Source§impl Authorizer for RoleAuthorizer
impl Authorizer for RoleAuthorizer
§Errors
A request naming more ancestors than RoleLimits::ancestors allows.
Source§impl Clone for RoleAuthorizer
impl Clone for RoleAuthorizer
Source§impl Debug for RoleAuthorizer
impl Debug for RoleAuthorizer
Source§impl Default for RoleAuthorizer
The empty policy, which denies everything, with the default limits.
impl Default for RoleAuthorizer
The empty policy, which denies everything, with the default limits.
Source§impl ProviderDecl for RoleAuthorizer
impl ProviderDecl for RoleAuthorizer
Source§impl TryFrom<Described<RolePolicy>> for RoleAuthorizer
impl TryFrom<Described<RolePolicy>> for RoleAuthorizer
Source§type Error = RolePolicyError
type Error = RolePolicyError
The type returned in the event of a conversion error.
Source§fn try_from(policy: Described<RolePolicy>) -> Result<Self, RolePolicyError>
fn try_from(policy: Described<RolePolicy>) -> Result<Self, RolePolicyError>
Performs the conversion.
Source§impl TryFrom<RolePolicy> for RoleAuthorizer
impl TryFrom<RolePolicy> for RoleAuthorizer
Source§type Error = RolePolicyError
type Error = RolePolicyError
The type returned in the event of a conversion error.
Source§fn try_from(policy: RolePolicy) -> Result<Self, RolePolicyError>
fn try_from(policy: RolePolicy) -> Result<Self, RolePolicyError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for RoleAuthorizer
impl RefUnwindSafe for RoleAuthorizer
impl Send for RoleAuthorizer
impl Sync for RoleAuthorizer
impl Unpin for RoleAuthorizer
impl UnsafeUnpin for RoleAuthorizer
impl UnwindSafe for RoleAuthorizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more