pub struct Engine<S, C = NoCache> { /* private fields */ }Expand description
RBAC engine with pluggable store and optional cache.
Implementations§
Source§impl<S, C> Engine<S, C>
impl<S, C> Engine<S, C>
Authorizes a principal for a permission within a tenant.
Authorizes a principal for a permission within a tenant.
Sourcepub async fn scope(
&self,
tenant: TenantId,
principal: PrincipalId,
resource: ResourceName,
) -> Result<Scope>
pub async fn scope( &self, tenant: TenantId, principal: PrincipalId, resource: ResourceName, ) -> Result<Scope>
Computes scope for a resource within a tenant.
Sourcepub async fn scope_ref(
&self,
tenant: &TenantId,
principal: &PrincipalId,
resource: &ResourceName,
) -> Result<Scope>
pub async fn scope_ref( &self, tenant: &TenantId, principal: &PrincipalId, resource: &ResourceName, ) -> Result<Scope>
Computes scope for a resource within a tenant.
Trait Implementations§
Auto Trait Implementations§
impl<S, C> Freeze for Engine<S, C>
impl<S, C> RefUnwindSafe for Engine<S, C>where
S: RefUnwindSafe,
C: RefUnwindSafe,
impl<S, C> Send for Engine<S, C>
impl<S, C> Sync for Engine<S, C>
impl<S, C> Unpin for Engine<S, C>
impl<S, C> UnsafeUnpin for Engine<S, C>where
S: UnsafeUnpin,
C: UnsafeUnpin,
impl<S, C> UnwindSafe for Engine<S, C>where
S: UnwindSafe,
C: UnwindSafe,
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