pub enum OpEntity {
Public,
RequiresAuthentication,
Role(String),
User(String),
}Expand description
An entity key inside an operation’s permission object.
pointerFields is not here: it is a sibling key whose value is an array of field names rather
than an entity granted true, and conflating the two is how a permission object stops being a
map from principal to grant.
Variants§
Public
"*"
RequiresAuthentication
"requiresAuthentication". Not a principal: a predicate over the caller.
Role(String)
"role:<name>", stored without the prefix.
User(String)
An objectId.
Implementations§
Source§impl OpEntity
impl OpEntity
Sourcepub fn parse(key: &str) -> Self
pub fn parse(key: &str) -> Self
Total, so a role:-prefixed string can never end up in the User arm.
That totality is the mitigation for the role: objectId collision: upstream has to guard
it at two call sites with an explicit startsWith check (Auth.js:195, :237) precisely
because its entity namespace is one flat untyped string space.
pub fn as_key(&self) -> String
Trait Implementations§
impl Eq for OpEntity
impl StructuralPartialEq for OpEntity
Auto Trait Implementations§
impl Freeze for OpEntity
impl RefUnwindSafe for OpEntity
impl Send for OpEntity
impl Sync for OpEntity
impl Unpin for OpEntity
impl UnsafeUnpin for OpEntity
impl UnwindSafe for OpEntity
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.