pub enum AclScope {
Unrestricted,
Anonymous,
User {
object_id: String,
},
}Expand description
Who a request is acting as, for ACL purposes.
An enum rather than an Option<String> so that “no ACL constraint at all” cannot be reached
by forgetting to set a field. acl === undefined as a master sentinel is the upstream shape
this deliberately does not copy.
Variants§
Unrestricted
Master or maintenance: no ACL constraint is applied at all.
Anonymous
A caller acting as nobody in particular.
User
A logged-in user. Roles are out of scope for 0.1.0, so a role: entry never matches.
Implementations§
Source§impl AclScope
impl AclScope
Sourcepub fn read_constraint(&self) -> Option<Constraint>
pub fn read_constraint(&self) -> Option<Constraint>
The constraint to add to a read.
None for AclScope::Unrestricted, which is the only case where no constraint is
applied. Returning Option makes the master case explicit at every call site instead of
being the absence of a step.
Sourcepub fn write_constraint(&self) -> Option<Constraint>
pub fn write_constraint(&self) -> Option<Constraint>
The constraint to add to a write.
Note the asymmetry with reads: addWriteACL omits '*' from the injected list, because
getUserAndRoleACL already seeds it for every non-master caller. Reproduced rather than
unified, since the two functions are not symmetric upstream and a caller path that builds
its own list would behave differently.
Trait Implementations§
impl Eq for AclScope
impl StructuralPartialEq for AclScope
Auto Trait Implementations§
impl Freeze for AclScope
impl RefUnwindSafe for AclScope
impl Send for AclScope
impl Sync for AclScope
impl Unpin for AclScope
impl UnsafeUnpin for AclScope
impl UnwindSafe for AclScope
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.