pub struct PostgresRoleDelegationRepository { /* private fields */ }Implementations§
Trait Implementations§
Source§impl RoleDelegationRepository for PostgresRoleDelegationRepository
impl RoleDelegationRepository for PostgresRoleDelegationRepository
Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
a: &'life1 UserRoleAssignment,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
a: &'life1 UserRoleAssignment,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist a freshly created delegation assignment.
Source§fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserRoleAssignment>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserRoleAssignment>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Look up a delegation row by id. Returns
None if not found OR not a
delegation row (i.e. valid_until IS NULL).Source§fn find_active_by_user_and_role<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: Uuid,
role: &'life1 UserRole,
organization_id: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserRoleAssignment>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_active_by_user_and_role<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: Uuid,
role: &'life1 UserRole,
organization_id: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserRoleAssignment>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up the (active or expired) assignments currently held by
user_id
with a given role. Used to enforce the @security non-transitive
invariant (the caller must have a native assignment for the role
they want to delegate) and the anti-double-grant 409.Source§fn list_delegations_of<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserRoleAssignment>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_delegations_of<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserRoleAssignment>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all active delegations involving
user_id, either as target
(received) or as delegator (granted). Used by the audit list view.Source§fn revoke<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn revoke<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Revoke a delegation by its assignment id (best-effort delete).
Idempotent: revoking an already-removed row returns
Ok(()).Auto Trait Implementations§
impl !RefUnwindSafe for PostgresRoleDelegationRepository
impl !UnwindSafe for PostgresRoleDelegationRepository
impl Freeze for PostgresRoleDelegationRepository
impl Send for PostgresRoleDelegationRepository
impl Sync for PostgresRoleDelegationRepository
impl Unpin for PostgresRoleDelegationRepository
impl UnsafeUnpin for PostgresRoleDelegationRepository
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
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.