pub enum RolePrincipal<'a> {
Master,
Maintenance,
Anonymous,
User(&'a str),
}Expand description
Who is asking.
Upstream’s short-circuit is if (this.isMaster || this.isMaintenance || !this.user) return []
(Auth.js:253-256). Modelling it as an argument rather than leaving it to the caller means
there is no way to call this “for the master key” and get a real role list back: every variant
is matched here, and three of them never reach storage.
Variants§
Master
The master key. Bypasses roles entirely, because it bypasses everything roles feed.
Maintenance
The maintenance key. Same.
Anonymous
No session. Note this is not Parse’s anonymous auth provider, which produces a real
_User and takes the User arm; it is the absence of a user.
User(&'a str)
Trait Implementations§
Source§impl<'a> Clone for RolePrincipal<'a>
impl<'a> Clone for RolePrincipal<'a>
Source§fn clone(&self) -> RolePrincipal<'a>
fn clone(&self) -> RolePrincipal<'a>
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 moreimpl<'a> Copy for RolePrincipal<'a>
Source§impl<'a> Debug for RolePrincipal<'a>
impl<'a> Debug for RolePrincipal<'a>
impl<'a> Eq for RolePrincipal<'a>
Source§impl<'a> PartialEq for RolePrincipal<'a>
impl<'a> PartialEq for RolePrincipal<'a>
impl<'a> StructuralPartialEq for RolePrincipal<'a>
Auto Trait Implementations§
impl<'a> Freeze for RolePrincipal<'a>
impl<'a> RefUnwindSafe for RolePrincipal<'a>
impl<'a> Send for RolePrincipal<'a>
impl<'a> Sync for RolePrincipal<'a>
impl<'a> Unpin for RolePrincipal<'a>
impl<'a> UnsafeUnpin for RolePrincipal<'a>
impl<'a> UnwindSafe for RolePrincipal<'a>
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
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
Compare self to
key and return true if they are equal.