pub enum GroupRole {
Owner,
Admin,
Moderator,
Member,
}Expand description
Roles within a group
Hierarchical roles that determine what actions a member can perform. Roles are ordered from highest (Owner) to lowest (Member) privilege.
Variants§
Owner
Group owner (highest privilege)
Can perform all actions including deleting the group and managing all other roles.
Admin
Administrator
Can manage most group settings and moderate other members.
Moderator
Moderator
Can moderate discussions and manage some group settings.
Member
Regular member
Basic participation rights, can post activities and read group content.
Implementations§
Source§impl GroupRole
impl GroupRole
Sourcepub fn has_permission(&self, required: &Permission) -> bool
pub fn has_permission(&self, required: &Permission) -> bool
Check if this role has the required permission level
Returns true if this role meets or exceeds the required permission level.
Sourcepub fn display_name(&self) -> &'static str
pub fn display_name(&self) -> &'static str
Get a human-readable name for this role
Sourcepub fn can_assign_role(&self, target_role: &GroupRole) -> bool
pub fn can_assign_role(&self, target_role: &GroupRole) -> bool
Check if this role can assign the target role to another member
Generally, you can only assign roles that are lower than your own.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GroupRole
impl<'de> Deserialize<'de> for GroupRole
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 Ord for GroupRole
impl Ord for GroupRole
Source§impl PartialOrd for GroupRole
impl PartialOrd for GroupRole
impl Eq for GroupRole
impl StructuralPartialEq for GroupRole
Auto Trait Implementations§
impl Freeze for GroupRole
impl RefUnwindSafe for GroupRole
impl Send for GroupRole
impl Sync for GroupRole
impl Unpin for GroupRole
impl UnwindSafe for GroupRole
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> 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> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> 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.