pub struct Access<C = ()> {
pub conditions: Option<C>,
pub level: AccessLevel,
}Expand description
A level of access with optional conditions which can be assigned to an actor.
Access can be used to understand the rights of an actor to perform actions (request data, write data, etc..) within a certain data set. Custom conditions can be defined by the user in order to introduce domain specific access boundaries or integrate with another access token.
For example, a condition to model access boundaries using paths could be introduced where having access to “/public” gives you access to “/public/stuff” and “/public/other/stuff” but not “/private” or “/private/stuff”.
Fields§
§conditions: Option<C>§level: AccessLevelImplementations§
Source§impl<C> Access<C>
impl<C> Access<C>
Sourcepub fn with_conditions(self, conditions: C) -> Self
pub fn with_conditions(self, conditions: C) -> Self
Attach conditions to an access level.
Trait Implementations§
Source§impl<'de, C> Deserialize<'de> for Access<C>where
C: Deserialize<'de>,
impl<'de, C> Deserialize<'de> for Access<C>where
C: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<C: Eq> Eq for Access<C>
Source§impl<C: PartialOrd + Eq> Ord for Access<C>
impl<C: PartialOrd + Eq> Ord for Access<C>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<C: PartialOrd> PartialOrd for Access<C>
impl<C: PartialOrd> PartialOrd for Access<C>
impl<C: PartialEq> StructuralPartialEq for Access<C>
Auto Trait Implementations§
impl<C> Freeze for Access<C>where
C: Freeze,
impl<C> RefUnwindSafe for Access<C>where
C: RefUnwindSafe,
impl<C> Send for Access<C>where
C: Send,
impl<C> Sync for Access<C>where
C: Sync,
impl<C> Unpin for Access<C>where
C: Unpin,
impl<C> UnsafeUnpin for Access<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for Access<C>where
C: UnwindSafe,
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.