pub struct AuthorizationEngine<Resource> { /* private fields */ }Expand description
Deny-overrides authorizer combining exact RBAC grants and ABAC policies.
Implementations§
Source§impl<Resource: 'static> AuthorizationEngine<Resource>
impl<Resource: 'static> AuthorizationEngine<Resource>
pub fn new(rbac: Rbac) -> Self
pub fn policy(self, policy: impl AbacPolicy<Resource>) -> Self
pub fn audit(self, audit: impl AuthorizationAudit) -> Self
Apply deny-overrides combining: any deny rejects, otherwise any allow permits.
§Errors
Returns a generic denial when no rule allows or any rule denies.
Trait Implementations§
Auto Trait Implementations§
impl<Resource> !RefUnwindSafe for AuthorizationEngine<Resource>
impl<Resource> !UnwindSafe for AuthorizationEngine<Resource>
impl<Resource> Forget for AuthorizationEngine<Resource>
impl<Resource> Freeze for AuthorizationEngine<Resource>where
*const ArcInner<HashMap<Arc<str>, HashSet<Permission>>> is !null: Freeze,
PhantomData<ArcInner<HashMap<Arc<str>, HashSet<Permission>>>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Arc<dyn AbacPolicy<Resource>>>: Freeze,
*const ArcInner<dyn AuthorizationAudit> is !null: Freeze,
PhantomData<ArcInner<dyn AuthorizationAudit>>: Freeze,
impl<Resource> Move for AuthorizationEngine<Resource>
impl<Resource> Send for AuthorizationEngine<Resource>where
Arc<HashMap<Arc<str>, HashSet<Permission>>>: Send,
RawVecInner: Send,
Arc<dyn AbacPolicy<Resource>>: Send,
Arc<dyn AuthorizationAudit>: Send,
impl<Resource> Sync for AuthorizationEngine<Resource>where
Arc<HashMap<Arc<str>, HashSet<Permission>>>: Sync,
RawVecInner: Sync,
Arc<dyn AbacPolicy<Resource>>: Sync,
Arc<dyn AuthorizationAudit>: Sync,
impl<Resource> Unpin for AuthorizationEngine<Resource>
impl<Resource> UnsafeUnpin for AuthorizationEngine<Resource>where
*const ArcInner<HashMap<Arc<str>, HashSet<Permission>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<HashMap<Arc<str>, HashSet<Permission>>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Arc<dyn AbacPolicy<Resource>>>: UnsafeUnpin,
*const ArcInner<dyn AuthorizationAudit> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn AuthorizationAudit>>: UnsafeUnpin,
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