#[non_exhaustive]pub struct PermissionSet {
pub policy: Arc<dyn PermissionPolicy>,
pub grants: Option<Arc<dyn PermissionGrants>>,
pub path_denials: Option<Arc<dyn PathDenials>>,
pub paths: Option<Arc<dyn PathGuard>>,
}Expand description
A session’s permission: the policy its calls are judged by and where the
allows it is handed are kept. With no grants nothing is kept, so nobody
is offered an “allow every time”. With no paths the engine writes
nowhere on its own judgment — a plugin command’s writes cover nothing, a
rewind restores no file — and no narrow-only grant is kept.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.policy: Arc<dyn PermissionPolicy>§grants: Option<Arc<dyn PermissionGrants>>§path_denials: Option<Arc<dyn PathDenials>>§paths: Option<Arc<dyn PathGuard>>Implementations§
Source§impl PermissionSet
impl PermissionSet
Sourcepub fn of<P: PermissionPolicy + PermissionGrants + PathDenials + 'static>(
p: Arc<P>,
) -> Self
pub fn of<P: PermissionPolicy + PermissionGrants + PathDenials + 'static>( p: Arc<P>, ) -> Self
One value that both decides and keeps grants, so what it is granted
changes what it decides. It carries no path guard: add one with
Self::with_paths (the permission engine’s permissions::session_set
does both).
pub fn without_grants(policy: Arc<dyn PermissionPolicy>) -> Self
pub fn with_paths(self, paths: Arc<dyn PathGuard>) -> Self
Sourcepub fn wrapping(
&self,
policy: Arc<dyn PermissionPolicy>,
path_denials: Option<Arc<dyn PathDenials>>,
) -> Self
pub fn wrapping( &self, policy: Arc<dyn PermissionPolicy>, path_denials: Option<Arc<dyn PathDenials>>, ) -> Self
This set with its calls judged by policy and its walks by
path_denials, keeping everything else it holds.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PermissionSet
impl !UnwindSafe for PermissionSet
impl Forget for PermissionSet
impl Freeze for PermissionSetwhere
*const ArcInner<dyn PermissionPolicy> is !null: Freeze,
PhantomData<ArcInner<dyn PermissionPolicy>>: Freeze,
*const ArcInner<dyn PermissionGrants> is !null: Freeze,
PhantomData<ArcInner<dyn PermissionGrants>>: Freeze,
*const ArcInner<dyn PathDenials> is !null: Freeze,
PhantomData<ArcInner<dyn PathDenials>>: Freeze,
*const ArcInner<dyn PathGuard> is !null: Freeze,
PhantomData<ArcInner<dyn PathGuard>>: Freeze,
impl Move for PermissionSet
impl Send for PermissionSetwhere
Arc<dyn PermissionPolicy>: Send,
Arc<dyn PermissionGrants>: Send,
Arc<dyn PathDenials>: Send,
Arc<dyn PathGuard>: Send,
impl Sync for PermissionSetwhere
Arc<dyn PermissionPolicy>: Sync,
Arc<dyn PermissionGrants>: Sync,
Arc<dyn PathDenials>: Sync,
Arc<dyn PathGuard>: Sync,
impl Unpin for PermissionSetwhere
Arc<dyn PermissionPolicy>: Unpin,
Arc<dyn PermissionGrants>: Unpin,
Arc<dyn PathDenials>: Unpin,
Arc<dyn PathGuard>: Unpin,
impl UnsafeUnpin for PermissionSetwhere
*const ArcInner<dyn PermissionPolicy> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn PermissionPolicy>>: UnsafeUnpin,
*const ArcInner<dyn PermissionGrants> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn PermissionGrants>>: UnsafeUnpin,
*const ArcInner<dyn PathDenials> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn PathDenials>>: UnsafeUnpin,
*const ArcInner<dyn PathGuard> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn PathGuard>>: UnsafeUnpin,
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