pub struct RoleAssignmentManager { /* private fields */ }Expand description
Role assignment manager
Implementations§
Source§impl RoleAssignmentManager
impl RoleAssignmentManager
Sourcepub fn assign_role(&mut self, assignment: RoleAssignment) -> Result<()>
pub fn assign_role(&mut self, assignment: RoleAssignment) -> Result<()>
Assign a role to a principal
Sourcepub fn revoke_role(
&mut self,
principal_id: &PrincipalId,
role_id: &RoleId,
) -> Result<()>
pub fn revoke_role( &mut self, principal_id: &PrincipalId, role_id: &RoleId, ) -> Result<()>
Revoke a role from a principal
Sourcepub fn get_principal_roles(
&self,
principal_id: &PrincipalId,
) -> Vec<&RoleAssignment>
pub fn get_principal_roles( &self, principal_id: &PrincipalId, ) -> Vec<&RoleAssignment>
Get all roles assigned to a principal
Sourcepub fn get_role_principals(&self, role_id: &RoleId) -> Vec<&RoleAssignment>
pub fn get_role_principals(&self, role_id: &RoleId) -> Vec<&RoleAssignment>
Get all principals with a specific role
Sourcepub fn has_role(&self, principal_id: &PrincipalId, role_id: &RoleId) -> bool
pub fn has_role(&self, principal_id: &PrincipalId, role_id: &RoleId) -> bool
Check if a principal has a specific role
Sourcepub fn get_all_assignments(&self) -> Vec<&RoleAssignment>
pub fn get_all_assignments(&self) -> Vec<&RoleAssignment>
Get all active assignments
Trait Implementations§
Source§impl Clone for RoleAssignmentManager
impl Clone for RoleAssignmentManager
Source§impl Debug for RoleAssignmentManager
impl Debug for RoleAssignmentManager
Source§impl Default for RoleAssignmentManager
impl Default for RoleAssignmentManager
Source§impl<'de> Deserialize<'de> for RoleAssignmentManager
impl<'de> Deserialize<'de> for RoleAssignmentManager
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RoleAssignmentManager
impl RefUnwindSafe for RoleAssignmentManager
impl Send for RoleAssignmentManager
impl Sync for RoleAssignmentManager
impl Unpin for RoleAssignmentManager
impl UnsafeUnpin for RoleAssignmentManager
impl UnwindSafe for RoleAssignmentManager
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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