Struct RoleQuery

Source
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>

Source

pub fn find_subjects_with_role(&self, role_name: &str) -> Result<Vec<String>>

Find all subjects that have the specified role.

Source

pub fn subjects_with_any_role(&self, role_names: &[&str]) -> Result<Vec<String>>

Find all subjects that have any of the specified roles.

Source

pub fn subjects_with_all_roles( &self, role_names: &[&str], ) -> Result<Vec<String>>

Find all subjects that have all of the specified roles.

Source

pub fn effective_permissions( &self, subject: &Subject, ) -> Result<Vec<Permission>>

Get all effective permissions for a subject.

Source

pub fn roles_with_permission( &self, permission: &Permission, ) -> Result<Vec<String>>

Find all roles that contain a specific permission.

Source

pub fn role_hierarchy(&self) -> HashMap<String, Vec<String>>

Get role hierarchy information.

Source

pub fn parent_roles(&self, child_role: &str) -> Vec<String>

Find all parent roles of a given role.

Source

pub fn child_roles(&self, parent_role: &str) -> Vec<String>

Find all child roles of a given role.

Source

pub fn system_statistics(&self) -> Result<SystemStatistics>

Generate system statistics.

Source

pub fn permission_coverage( &self, subjects: &[Subject], ) -> Result<PermissionCoverage>

Get permission coverage statistics.

Source

pub fn unused_roles(&self) -> Result<Vec<String>>

Find unused roles (roles with no subjects assigned).

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.