Struct wicrs_server::hub::PermissionGroup[][src]

pub struct PermissionGroup {
    pub id: ID,
    pub name: String,
    pub members: Vec<ID>,
    pub hub_permissions: HubPermissions,
    pub channel_permissions: HashMap<ID, ChannelPermissions>,
    pub created: DateTime<Utc>,
}

Represents a set of permissions that can be easily given to any hub member.

Fields

id: ID

ID of the group.

name: String

Name of the group.

members: Vec<ID>

Array of the IDs of hub members who are members of the group.

hub_permissions: HubPermissions

Hub permission settings that the group has.

channel_permissions: HashMap<ID, ChannelPermissions>

Mapping of channel permission settings the group has to the channel they apply to.

created: DateTime<Utc>

Time in milliseconds since Unix Epoch that the group was created.

Implementations

impl PermissionGroup[src]

pub fn new(name: String, id: ID) -> Self[src]

Creates a new permission group given a name and an ID.

pub fn add_member(&mut self, user: &mut HubMember)[src]

Adds a hub member to the group, maps to HubMember::join_group.

pub fn remove_member(&mut self, user: &mut HubMember)[src]

Removes a hub member from the group, maps to HubMember::leave_group.

pub fn set_permission(
    &mut self,
    permission: HubPermission,
    value: PermissionSetting
)
[src]

Changes the setting of a hub permission for the group.

pub fn set_channel_permission(
    &mut self,
    channel_id: ID,
    permission: ChannelPermission,
    value: PermissionSetting
)
[src]

Changes the setting of a channel permission for a specific channel for the group.

pub fn has_all_permissions(&self) -> bool[src]

Checks if the group has the All permission.

pub fn has_permission(&self, permission: &HubPermission) -> bool[src]

Checks if the group has a permission.

pub fn has_channel_permission(
    &self,
    channel_id: &ID,
    permission: ChannelPermission
) -> bool
[src]

Checks if the group has a permission in a specific channel.

Trait Implementations

impl Clone for PermissionGroup[src]

impl ContainerType for PermissionGroup[src]

impl Debug for PermissionGroup[src]

impl<'de> Deserialize<'de> for PermissionGroup[src]

impl ObjectType for PermissionGroup[src]

impl OutputType for PermissionGroup[src]

impl PartialEq<PermissionGroup> for PermissionGroup[src]

impl Serialize for PermissionGroup[src]

impl StructuralPartialEq for PermissionGroup[src]

impl Type for PermissionGroup[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> From<T> for T[src]

impl<T> Fruit for T where
    T: Send + Downcast, 
[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoResult<T> for T[src]

type Err = Infallible

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,