pub struct ChannelAdmin { /* private fields */ }Expand description
Channel administration manager
Implementations§
Source§impl ChannelAdmin
impl ChannelAdmin
Sourcepub fn new(
user_id: String,
user_role: MemberRole,
user_permissions: HashSet<Permission>,
) -> Self
pub fn new( user_id: String, user_role: MemberRole, user_permissions: HashSet<Permission>, ) -> Self
Create a new channel admin context
Sourcepub fn can_perform(
&self,
operation: &AdminOperation,
target_channel: &ChannelSettings,
) -> bool
pub fn can_perform( &self, operation: &AdminOperation, target_channel: &ChannelSettings, ) -> bool
Check if the user can perform a specific operation
Sourcepub fn has_permission(&self, permission: &Permission) -> bool
pub fn has_permission(&self, permission: &Permission) -> bool
Check if user has a specific permission (from role or custom grants)
Sourcepub fn get_permissions(&self) -> HashSet<Permission>
pub fn get_permissions(&self) -> HashSet<Permission>
Get all permissions for this user
Sourcepub fn can_manage_user_role(&self, target_role: &MemberRole) -> bool
pub fn can_manage_user_role(&self, target_role: &MemberRole) -> bool
Check if user can manage another user’s role
Auto Trait Implementations§
impl Freeze for ChannelAdmin
impl RefUnwindSafe for ChannelAdmin
impl Send for ChannelAdmin
impl Sync for ChannelAdmin
impl Unpin for ChannelAdmin
impl UnsafeUnpin for ChannelAdmin
impl UnwindSafe for ChannelAdmin
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