pub enum Permission {
Admin(u32),
Write(u32),
Read,
}Expand description
Permission levels for authenticated operations
Variants§
Admin(u32)
Full administrative access including settings and key management Priority may be used for conflict resolution, lower number = higher priority Admin keys always have priority over Write keys
Write(u32)
Read and write access to data (excludes settings modifications) Priority may be used for conflict resolution, lower number = higher priority
Read
Read-only access to data
Implementations§
Source§impl Permission
impl Permission
Sourcepub fn clamp_to(&self, max_permission: &Permission) -> Permission
pub fn clamp_to(&self, max_permission: &Permission) -> Permission
Clamp permissions to a maximum level
Used for delegated tree delegation to ensure users cannot escalate their permissions beyond what was granted in the main tree. Returns the minimum of self and max_permission.
Sourcepub fn clamp_to_bounds(&self, bounds: &PermissionBounds) -> Permission
pub fn clamp_to_bounds(&self, bounds: &PermissionBounds) -> Permission
Clamp permissions within bounds (for delegated trees)
Applies both minimum and maximum bounds from PermissionBounds. If min is specified and self is below min, raises to min. If self is above max, lowers to max.
Trait Implementations§
Source§impl Clone for Permission
impl Clone for Permission
Source§fn clone(&self) -> Permission
fn clone(&self) -> Permission
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Permission
impl Debug for Permission
Source§impl<'de> Deserialize<'de> for Permission
impl<'de> Deserialize<'de> for Permission
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>,
Source§impl From<Permission> for Doc
impl From<Permission> for Doc
Source§fn from(perm: Permission) -> Doc
fn from(perm: Permission) -> Doc
Source§impl From<Permission> for String
impl From<Permission> for String
Source§fn from(permission: Permission) -> Self
fn from(permission: Permission) -> Self
Source§impl From<Permission> for Value
impl From<Permission> for Value
Source§fn from(perm: Permission) -> Value
fn from(perm: Permission) -> Value
Source§impl Ord for Permission
impl Ord for Permission
Source§impl PartialEq for Permission
impl PartialEq for Permission
Source§impl PartialOrd for Permission
impl PartialOrd for Permission
Source§impl Serialize for Permission
impl Serialize for Permission
Source§impl TryFrom<&Doc> for Permission
impl TryFrom<&Doc> for Permission
Source§impl TryFrom<String> for Permission
impl TryFrom<String> for Permission
impl Copy for Permission
impl Eq for Permission
impl StructuralPartialEq for Permission
Auto Trait Implementations§
impl Freeze for Permission
impl RefUnwindSafe for Permission
impl Send for Permission
impl Sync for Permission
impl Unpin for Permission
impl UnwindSafe for Permission
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more