pub struct DelegationManager { /* private fields */ }Expand description
Manager for permission delegations
Implementations§
Source§impl DelegationManager
impl DelegationManager
Sourcepub async fn create_delegation(&self, delegation: Delegation) -> Result<String>
pub async fn create_delegation(&self, delegation: Delegation) -> Result<String>
Create a new delegation
Sourcepub async fn revoke_delegation(&self, delegation_id: &str) -> Result<()>
pub async fn revoke_delegation(&self, delegation_id: &str) -> Result<()>
Revoke a delegation by ID
Sourcepub async fn get_delegation(
&self,
delegation_id: &str,
) -> Result<Option<Delegation>>
pub async fn get_delegation( &self, delegation_id: &str, ) -> Result<Option<Delegation>>
Get a delegation by ID
Sourcepub async fn check_delegation(
&self,
delegate: &Subject,
namespace: &str,
object_id: &str,
relation: &str,
) -> Result<bool>
pub async fn check_delegation( &self, delegate: &Subject, namespace: &str, object_id: &str, relation: &str, ) -> Result<bool>
Check if a subject has a delegated permission
Sourcepub async fn list_delegations_for_delegate(
&self,
delegate: &Subject,
) -> Result<Vec<Delegation>>
pub async fn list_delegations_for_delegate( &self, delegate: &Subject, ) -> Result<Vec<Delegation>>
List all active delegations for a delegate
Sourcepub async fn list_delegations_by_delegator(
&self,
delegator: &Subject,
) -> Result<Vec<Delegation>>
pub async fn list_delegations_by_delegator( &self, delegator: &Subject, ) -> Result<Vec<Delegation>>
List all delegations created by a delegator
Sourcepub async fn cleanup_expired(&self) -> Result<usize>
pub async fn cleanup_expired(&self) -> Result<usize>
Clean up expired and revoked delegations
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DelegationManager
impl !RefUnwindSafe for DelegationManager
impl Send for DelegationManager
impl Sync for DelegationManager
impl Unpin for DelegationManager
impl !UnwindSafe for DelegationManager
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
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