pub struct PermissionSet {
pub name: String,
pub description: String,
pub permissions: Vec<Permission>,
}Expand description
Permission set for grouping related permissions
Fields§
§name: StringName of the permission set
description: StringDescription of what this set enables
permissions: Vec<Permission>Individual permissions in this set
Implementations§
Source§impl PermissionSet
impl PermissionSet
Sourcepub fn new(
name: String,
description: String,
permissions: Vec<Permission>,
) -> Self
pub fn new( name: String, description: String, permissions: Vec<Permission>, ) -> Self
Create a new permission set
Sourcepub fn file_system() -> Self
pub fn file_system() -> Self
Create a file system permission set
Sourcepub fn system_admin() -> Self
pub fn system_admin() -> Self
Create a system administration permission set
Sourcepub fn max_risk_level(&self) -> u8
pub fn max_risk_level(&self) -> u8
Get the maximum risk level in this permission set
Sourcepub fn requires_user_consent(&self) -> bool
pub fn requires_user_consent(&self) -> bool
Check if any permissions require user consent
Trait Implementations§
Source§impl Clone for PermissionSet
impl Clone for PermissionSet
Source§fn clone(&self) -> PermissionSet
fn clone(&self) -> PermissionSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PermissionSet
impl RefUnwindSafe for PermissionSet
impl Send for PermissionSet
impl Sync for PermissionSet
impl Unpin for PermissionSet
impl UnwindSafe for PermissionSet
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,
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 more