pub struct PermissionGroups {
default_groups: Vec<String>,
groups: BTreeMap<String, PermissionGroup>,
}Expand description
Validated, parsed permission groups.
Fields§
§default_groups: Vec<String>§groups: BTreeMap<String, PermissionGroup>Implementations§
Source§impl PermissionGroups
impl PermissionGroups
Sourcepub fn from_config(
config: PermissionGroupsConfig,
) -> Result<Self, PermissionConfigError>
pub fn from_config( config: PermissionGroupsConfig, ) -> Result<Self, PermissionConfigError>
Validates and parses permission group configuration.
§Errors
Returns an error for invalid names, rules, default groups, or inheritance.
Sourcepub fn default_groups(&self) -> &[String]
pub fn default_groups(&self) -> &[String]
Returns the configured default group names.
Sourcepub const fn groups(&self) -> &BTreeMap<String, PermissionGroup>
pub const fn groups(&self) -> &BTreeMap<String, PermissionGroup>
Returns configured groups keyed by name.
Sourcepub fn contains_group(&self, group: &str) -> bool
pub fn contains_group(&self, group: &str) -> bool
Returns whether a group exists.
Sourcepub fn effective_permissions(
&self,
assigned_groups: &[String],
subject_permissions: &PermissionSet,
) -> PermissionSet
pub fn effective_permissions( &self, assigned_groups: &[String], subject_permissions: &PermissionSet, ) -> PermissionSet
Builds effective permissions from defaults, assigned groups, and subject overrides.
Unknown assigned groups have no effect. Each inherited group contributes at most once.
Sourcepub fn effective_metadata(
&self,
assigned_groups: &[String],
subject_metadata: &PermissionMetadataSet,
) -> PermissionMetadataSet
pub fn effective_metadata( &self, assigned_groups: &[String], subject_metadata: &PermissionMetadataSet, ) -> PermissionMetadataSet
Builds effective metadata from defaults, assigned groups, and subject overrides.
Unknown assigned groups have no effect. Each inherited group contributes at most once.
fn append_group( &self, group_name: &str, effective: &mut PermissionSet, appended_groups: &mut BTreeSet<String>, )
fn append_group_metadata( &self, group_name: &str, effective: &mut PermissionMetadataSet, appended_groups: &mut BTreeSet<String>, )
Trait Implementations§
Source§impl Clone for PermissionGroups
impl Clone for PermissionGroups
Source§fn clone(&self) -> PermissionGroups
fn clone(&self) -> PermissionGroups
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 PermissionGroups
impl Debug for PermissionGroups
impl Eq for PermissionGroups
Source§impl PartialEq for PermissionGroups
impl PartialEq for PermissionGroups
impl StructuralPartialEq for PermissionGroups
Auto Trait Implementations§
impl Freeze for PermissionGroups
impl RefUnwindSafe for PermissionGroups
impl Send for PermissionGroups
impl Sync for PermissionGroups
impl Unpin for PermissionGroups
impl UnsafeUnpin for PermissionGroups
impl UnwindSafe for PermissionGroups
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compares
self with key and returns true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreWraps this value in an
Arc<SyncMutex<>>