#[non_exhaustive]pub struct Acl {
pub entries: Vec<Entry>,
pub protected: bool,
pub mode: Mode,
}Expand description
An access control list.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.entries: Vec<Entry>The entries, in order.
protected: boolWhether it takes nothing from a parent (Acl::inherited_by): a protected DACL.
mode: ModeHow the entries combine. Default deny_overrides.
Implementations§
Source§impl Acl
impl Acl
Sourcepub fn check(
&self,
context: &Context<'_>,
wanted: &Rights,
) -> Result<Decision, AclError>
pub fn check( &self, context: &Context<'_>, wanted: &Rights, ) -> Result<Decision, AclError>
Whether the requester in context holds every right in wanted on an item with this
ACL. Entries marked inherit_only do not apply here. An applicable entry naming a
cancelling name refuses everything, in every mode.
An empty wanted is allowed: nothing was asked for.
§Errors
The ACL is not usable with this schema and these options: more entries than
Limits::entries, a name the schema lacks, a deny where
the mode has none, a principal the mode does not take.
Source§impl Acl
impl Acl
Sourcepub fn canonicalize(&mut self)
pub fn canonicalize(&mut self)
Sorts the entries into Windows’ canonical order: explicit denies, explicit allows, then inherited entries in the order they were. The sort is stable.
Sourcepub fn non_defaults(&self) -> Vec<NonDefault>
pub fn non_defaults(&self) -> Vec<NonDefault>
What this ACL grants more widely than the default does, for the caller to
report or refuse: every allow entry naming Everyone.
Source§impl Acl
impl Acl
Sourcepub fn inherited_by(
&self,
child: Child,
explicit: &Acl,
creator: Option<&Subject>,
) -> Acl
pub fn inherited_by( &self, child: Child, explicit: &Acl, creator: Option<&Subject>, ) -> Acl
The ACL a child of an item with this ACL gets: explicit’s own entries first, then
the copies this ACL passes down, marked inherited, in explicit’s mode. A
protected explicit takes nothing and comes back as it is; entries explicit
had inherited before are replaced.
The copies follow Windows’ table (items is OI, containers CI):
| parent entry | to an item | to a container |
|---|---|---|
items | applies, no flags | inherit-only, keeps items |
containers | nothing | applies, keeps containers |
| both | applies, no flags | applies, keeps both |
with no_propagate | applies, no flags (if items) | applies with no flags (if containers), else nothing |
A parent entry that is inherit_only is copied the same way; the copy applies.
With a creator, an Owner entry (Windows CREATOR OWNER) is copied as an entry for
the creator, and a container also keeps an inherit-only Owner entry to pass on.
Nothing is walked at check time: store the result.
Trait Implementations§
Source§impl Describe for Acl
impl Describe for Acl
impl Eq for Acl
Source§impl Extend<Entry> for Acl
impl Extend<Entry> for Acl
Source§fn extend<I: IntoIterator<Item = Entry>>(&mut self, entries: I)
fn extend<I: IntoIterator<Item = Entry>>(&mut self, entries: I)
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)