pub struct AccessControlManager { /* private fields */ }Expand description
Manages team member roles and permissions
Implementations§
Source§impl AccessControlManager
impl AccessControlManager
Sourcepub fn new(
permission_manager: Arc<PermissionManager>,
audit_logger: Arc<AuditLogger>,
) -> Self
pub fn new( permission_manager: Arc<PermissionManager>, audit_logger: Arc<AuditLogger>, ) -> Self
Create a new AccessControlManager
Sourcepub async fn assign_role(
&self,
team_id: &str,
member_id: &str,
role: TeamRole,
) -> Result<()>
pub async fn assign_role( &self, team_id: &str, member_id: &str, role: TeamRole, ) -> Result<()>
Assign a role to a team member
Sourcepub async fn check_permission(
&self,
member_id: &str,
action: &str,
resource: &str,
) -> Result<bool>
pub async fn check_permission( &self, member_id: &str, action: &str, resource: &str, ) -> Result<bool>
Check if a member has permission for an action
Sourcepub async fn grant_admin_permissions(&self, member_id: &str) -> Result<()>
pub async fn grant_admin_permissions(&self, member_id: &str) -> Result<()>
Grant Admin role permissions
Sourcepub async fn grant_member_permissions(&self, member_id: &str) -> Result<()>
pub async fn grant_member_permissions(&self, member_id: &str) -> Result<()>
Grant Member role permissions
Sourcepub async fn grant_viewer_permissions(&self, member_id: &str) -> Result<()>
pub async fn grant_viewer_permissions(&self, member_id: &str) -> Result<()>
Grant Viewer role permissions
Sourcepub async fn revoke_access(&self, team_id: &str, member_id: &str) -> Result<()>
pub async fn revoke_access(&self, team_id: &str, member_id: &str) -> Result<()>
Revoke all access for a member
Sourcepub async fn get_audit_log(&self, team_id: &str) -> Result<Vec<AuditLogEntry>>
pub async fn get_audit_log(&self, team_id: &str) -> Result<Vec<AuditLogEntry>>
Get audit log entries
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AccessControlManager
impl !RefUnwindSafe for AccessControlManager
impl Send for AccessControlManager
impl Sync for AccessControlManager
impl Unpin for AccessControlManager
impl !UnwindSafe for AccessControlManager
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