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
Source§impl<C: PartialOrd + Eq> Ord for Access<C>
impl<C: PartialOrd + Eq> Ord for Access<C>
Source§impl<C: PartialOrd> PartialOrd for Access<C>
impl<C: PartialOrd> PartialOrd for Access<C>
impl<C: Eq> Eq for Access<C>
impl<C> 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> 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
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
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.