pub struct RbacManager { /* private fields */ }Expand description
RBAC Manager — roles, policies, audit, and HitL approvals.
Implementations§
Source§impl RbacManager
impl RbacManager
Sourcepub fn assign_role(&mut self, subject: Subject, role: Role)
pub fn assign_role(&mut self, subject: Subject, role: Role)
Assign a role.
Sourcepub fn revoke_role(&mut self, subject: &Subject)
pub fn revoke_role(&mut self, subject: &Subject)
Revoke a role.
Sourcepub fn check_permission(
&mut self,
subject: &Subject,
action: &Action,
resource: &str,
) -> bool
pub fn check_permission( &mut self, subject: &Subject, action: &Action, resource: &str, ) -> bool
Check permission + audit.
Sourcepub fn request_approval(
&mut self,
subject: Subject,
action: Action,
resource: String,
reason: String,
) -> Uuid
pub fn request_approval( &mut self, subject: Subject, action: Action, resource: String, reason: String, ) -> Uuid
Request HitL approval.
Sourcepub fn pending_approvals(&self) -> Vec<&PendingApproval>
pub fn pending_approvals(&self) -> Vec<&PendingApproval>
Pending approvals.
Sourcepub fn all_approvals(&self) -> &[(PendingApproval, ApprovalStatus)]
pub fn all_approvals(&self) -> &[(PendingApproval, ApprovalStatus)]
All approvals with status.
Sourcepub fn audit_log(&self) -> &[RbacAuditEntry]
pub fn audit_log(&self) -> &[RbacAuditEntry]
Audit log.
Trait Implementations§
Source§impl Clone for RbacManager
impl Clone for RbacManager
Source§fn clone(&self) -> RbacManager
fn clone(&self) -> RbacManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RbacManager
impl Debug for RbacManager
Auto Trait Implementations§
impl Freeze for RbacManager
impl RefUnwindSafe for RbacManager
impl Send for RbacManager
impl Sync for RbacManager
impl Unpin for RbacManager
impl UnsafeUnpin for RbacManager
impl UnwindSafe for RbacManager
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