Module serenity::model::permissions[][src]

Expand description

A set of permissions for a role or user. These can be assigned directly to a role or as a channel’s permission overrides.

For convenience, methods for each permission are available, which can be used to test if the set of permissions contains a single permission. This can simplify code and reduce a potential import.

Additionally, presets equivalent to the official client’s @everyone role presets are available. These are PRESET_GENERAL, PRESET_TEXT, and PRESET_VOICE.

Permissions follow a hierarchy:

  • An account can grant roles to users that are of a lower position than its highest role;
  • An account can edit roles lesser than its highest role, but can only grant permissions they have;
  • An account can move only roles lesser than its highest role;
  • An account can only kick/ban accounts with a lesser role than its top role.

Note: The following permissions require the owner account (e.g. the owner of a bot) to use two-factor authentication in the case that a guild has guild-wide 2FA enabled:

Structs

A set of permissions that can be assigned to Users and Roles via PermissionOverwrites, roles globally in a Guild, and to GuildChannels.

Constants

Returns a set of permissions with the original @everyone permissions set to true.

Returns a set of text-only permissions with the original @everyone permissions set to true.

Returns a set of voice-only permissions with the original @everyone permissions set to true.