pub struct TenantScopeChecker { /* private fields */ }Expand description
基于租户范围的权限检查器。
维护一张“能力名 → 允许的租户 ID 集合“映射,
仅当调用方 tenant_id 在允许集合中时放行。
Implementations§
Trait Implementations§
Source§impl Default for TenantScopeChecker
impl Default for TenantScopeChecker
Source§impl PermissionChecker for TenantScopeChecker
impl PermissionChecker for TenantScopeChecker
Source§fn check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cap_name: &'life1 str,
_args: &'life2 Value,
tenant_id: i64,
) -> Pin<Box<dyn Future<Output = CapResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cap_name: &'life1 str,
_args: &'life2 Value,
tenant_id: i64,
) -> Pin<Box<dyn Future<Output = CapResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
检查指定租户是否有权调用该能力。 Read more
Auto Trait Implementations§
impl !Freeze for TenantScopeChecker
impl !RefUnwindSafe for TenantScopeChecker
impl Send for TenantScopeChecker
impl Sync for TenantScopeChecker
impl Unpin for TenantScopeChecker
impl UnsafeUnpin for TenantScopeChecker
impl UnwindSafe for TenantScopeChecker
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