pub struct AuthorizeEngine { /* private fields */ }Implementations§
Source§impl AuthorizeEngine
impl AuthorizeEngine
pub fn new( matrices: HashMap<&'static str, RoleMatrix>, owners: OwnerRegistry, ) -> Self
pub fn membership_cache(&self) -> &MembershipCache
pub fn matrix(&self, scope_kind: &str) -> Option<&RoleMatrix>
pub async fn membership( &self, db: &DbHandle, scope: ScopeRef, user_id: i64, ) -> Result<Option<Membership>>
pub async fn require_member( &self, db: &DbHandle, scope: ScopeRef, user_id: i64, ) -> Result<Membership>
pub async fn require_privileged( &self, db: &DbHandle, scope: ScopeRef, user_id: i64, ) -> Result<Membership>
pub async fn require_owner_role( &self, db: &DbHandle, scope: ScopeRef, user_id: i64, ) -> Result<Membership>
pub async fn is_privileged( &self, db: &DbHandle, scope: ScopeRef, user_id: i64, ) -> Result<bool>
pub async fn effective( &self, db: &DbHandle, scope: ScopeRef, user_id: i64, resource: Option<ResourceRef>, ) -> Result<Capabilities>
pub async fn can( &self, db: &DbHandle, scope: ScopeRef, user_id: i64, ability: Ability, resource: Option<ResourceRef>, ) -> Result<bool>
pub fn owners(&self) -> &OwnerRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for AuthorizeEngine
impl !UnwindSafe for AuthorizeEngine
impl Freeze for AuthorizeEngine
impl Send for AuthorizeEngine
impl Sync for AuthorizeEngine
impl Unpin for AuthorizeEngine
impl UnsafeUnpin for AuthorizeEngine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more