pub struct RoleQuery<'a, S: Storage> { /* private fields */ }Expand description
Query interface for role system analysis.
Implementations§
Source§impl<'a, S: Storage> RoleQuery<'a, S>
impl<'a, S: Storage> RoleQuery<'a, S>
Sourcepub fn find_subjects_with_role(&self, role_name: &str) -> Result<Vec<String>>
pub fn find_subjects_with_role(&self, role_name: &str) -> Result<Vec<String>>
Find all subjects that have the specified role.
Sourcepub fn subjects_with_any_role(&self, role_names: &[&str]) -> Result<Vec<String>>
pub fn subjects_with_any_role(&self, role_names: &[&str]) -> Result<Vec<String>>
Find all subjects that have any of the specified roles.
Sourcepub fn subjects_with_all_roles(
&self,
role_names: &[&str],
) -> Result<Vec<String>>
pub fn subjects_with_all_roles( &self, role_names: &[&str], ) -> Result<Vec<String>>
Find all subjects that have all of the specified roles.
Sourcepub fn effective_permissions(
&self,
subject: &Subject,
) -> Result<Vec<Permission>>
pub fn effective_permissions( &self, subject: &Subject, ) -> Result<Vec<Permission>>
Get all effective permissions for a subject.
Sourcepub fn roles_with_permission(
&self,
permission: &Permission,
) -> Result<Vec<String>>
pub fn roles_with_permission( &self, permission: &Permission, ) -> Result<Vec<String>>
Find all roles that contain a specific permission.
Sourcepub fn parent_roles(&self, child_role: &str) -> Vec<String>
pub fn parent_roles(&self, child_role: &str) -> Vec<String>
Find all parent roles of a given role.
Sourcepub fn child_roles(&self, parent_role: &str) -> Vec<String>
pub fn child_roles(&self, parent_role: &str) -> Vec<String>
Find all child roles of a given role.
Sourcepub fn system_statistics(&self) -> Result<SystemStatistics>
pub fn system_statistics(&self) -> Result<SystemStatistics>
Generate system statistics.
Sourcepub fn permission_coverage(
&self,
subjects: &[Subject],
) -> Result<PermissionCoverage>
pub fn permission_coverage( &self, subjects: &[Subject], ) -> Result<PermissionCoverage>
Get permission coverage statistics.
Sourcepub fn unused_roles(&self) -> Result<Vec<String>>
pub fn unused_roles(&self) -> Result<Vec<String>>
Find unused roles (roles with no subjects assigned).
Sourcepub fn max_hierarchy_depth(&self) -> Result<usize>
pub fn max_hierarchy_depth(&self) -> Result<usize>
Get the maximum depth of the role hierarchy.
Auto Trait Implementations§
impl<'a, S> Freeze for RoleQuery<'a, S>
impl<'a, S> !RefUnwindSafe for RoleQuery<'a, S>
impl<'a, S> Send for RoleQuery<'a, S>
impl<'a, S> Sync for RoleQuery<'a, S>
impl<'a, S> Unpin for RoleQuery<'a, S>
impl<'a, S> !UnwindSafe for RoleQuery<'a, S>
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