pub enum SubjectAccessLevel {
None,
Public,
Verified,
SecondDegree,
Follower,
Connected,
Owner,
}Expand description
Subject’s access level to a resource based on their relationship with the owner
Used to determine if a subject meets the visibility requirements. Higher levels grant access to more restrictive visibility settings.
Hierarchy: Owner > Connected > Follower > SecondDegree > Verified > Public > None
Variants§
None
No authentication or relationship
Public
Unauthenticated but public access requested
Verified
Authenticated user (has valid JWT from any federated instance)
SecondDegree
Has voucher token proving 2nd degree connection (future)
Follower
Follows the resource owner
Connected
Connected (mutual) with resource owner
Owner
Is the resource owner
Implementations§
Source§impl SubjectAccessLevel
impl SubjectAccessLevel
Sourcepub fn can_access(self, visibility: VisibilityLevel) -> bool
pub fn can_access(self, visibility: VisibilityLevel) -> bool
Check if this access level can view content with given visibility
Sourcepub fn visible_levels(self) -> Option<&'static [char]>
pub fn visible_levels(self) -> Option<&'static [char]>
Return the visibility level chars this access level can see.
Returns None for Owner (sees everything including NULL/Direct).
Used to push visibility filtering into SQL for correct pagination.
Trait Implementations§
Source§impl Clone for SubjectAccessLevel
impl Clone for SubjectAccessLevel
Source§fn clone(&self) -> SubjectAccessLevel
fn clone(&self) -> SubjectAccessLevel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubjectAccessLevel
impl Debug for SubjectAccessLevel
Source§impl Default for SubjectAccessLevel
impl Default for SubjectAccessLevel
Source§fn default() -> SubjectAccessLevel
fn default() -> SubjectAccessLevel
Source§impl Ord for SubjectAccessLevel
impl Ord for SubjectAccessLevel
Source§fn cmp(&self, other: &SubjectAccessLevel) -> Ordering
fn cmp(&self, other: &SubjectAccessLevel) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SubjectAccessLevel
impl PartialEq for SubjectAccessLevel
Source§impl PartialOrd for SubjectAccessLevel
impl PartialOrd for SubjectAccessLevel
impl Copy for SubjectAccessLevel
impl Eq for SubjectAccessLevel
impl StructuralPartialEq for SubjectAccessLevel
Auto Trait Implementations§
impl Freeze for SubjectAccessLevel
impl RefUnwindSafe for SubjectAccessLevel
impl Send for SubjectAccessLevel
impl Sync for SubjectAccessLevel
impl Unpin for SubjectAccessLevel
impl UnsafeUnpin for SubjectAccessLevel
impl UnwindSafe for SubjectAccessLevel
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().