dpp::permission
permissions.h
uint64_t uint64_t dpp::permission::value value dpp::permission::value {0}

The permission bitmask value.

constexpr dpp::permission::permission ()=default permission dpp::permission::permission

Default constructor, initializes permission to 0.

constexpr dpp::permission::permission (uint64_t value) noexcept permission dpp::permission::permission uint64_t value

Bitmask constructor, initializes permission to the argument.

value

The bitmask to initialize the permission to

typename... T T
std::enable_if_t<(std::is_convertible_v< T, uint64_t > &&...), permission & > constexpr std::enable_if_t<(std::is_convertible_v< T, uint64_t > &&...), permission & > constexpr dpp::permission::add (T... values) noexcept add dpp::permission::add T... values

Add a permission with the Bitwise OR operation.

T

one or more uint64_t permission bits

values

The permissions (from dpp::permissions) to add

Example:

    permission.add(dpp::p_view_channel,dpp::p_send_messages);
    //Addsp_view_channelandp_send_messagestothepermissionbitmask

permission& reference to self for chaining

typename... T T
bool bool dpp::permission::can (T... values) const noexcept can dpp::permission::can T... values

Check for certain permissions, taking into account administrator privileges. It uses the Bitwise AND operator.

T

one or more uint64_t permission bits

values

The permissions (from dpp::permissions) to check for

Example:

    boolis_mod=permission.can(dpp::p_kick_members,dpp::p_ban_members);
    //Returnstrueifithaspermissiontop_kick_membersandp_ban_members

bool True if it has all the given permissions or dpp::p_administrator

typename... T T
bool bool dpp::permission::can_any (T... values) const noexcept can_any dpp::permission::can_any T... values

Check for certain permissions, taking into account administrator privileges. It uses the Bitwise AND operator.

T

one or more uint64_t permission bits

values

The permissions (from dpp::permissions) to check for

Example:

    boolis_mod=permission.can_any(dpp::p_kick_members,dpp::p_ban_members);
    //Returnstrueifithaspermissiontop_kick_membersorp_ban_members

bool True if it has any of the given permissions or dpp::p_administrator

typename... T T
bool bool dpp::permission::has (T... values) const noexcept has dpp::permission::has T... values

Check for permission flags set. It uses the Bitwise AND operator.

T

one or more uint64_t permission bits

values

The permissions (from dpp::permissions) to check for

Example:

    boolis_mod=permission.has(dpp::p_kick_members,dpp::p_ban_members);
    //Returnstrueifthepermissionbitmaskcontainsp_kick_membersandp_ban_members

bool True if it has all the given permissions

typename... T T
bool bool dpp::permission::has_any (T... values) const noexcept has_any dpp::permission::has_any T... values

Check for permission flags set. It uses the Bitwise AND operator.

T

one or more uint64_t permission bits

values

The permissions (from dpp::permissions) to check for

Example:

    boolis_mod=permission.has_any(dpp::p_administrator,dpp::p_ban_members);
    //Returnstrueifthepermissionbitmaskcontainsp_administratororp_ban_members

bool True if it has any of the given permissions

constexpr dpp::permission::operator uint64_t () const noexcept operator uint64_t dpp::permission::operator uint64_t

For acting like an integer.

The permission bitmask value

constexpr dpp::permission::operator uint64_t & () noexcept operator uint64_t & dpp::permission::operator uint64_t &

For acting like an integer.

A reference to the permission bitmask value

typename... T T
std::enable_if_t<(std::is_convertible_v< T, uint64_t > &&...), permission & > constexpr std::enable_if_t<(std::is_convertible_v< T, uint64_t > &&...), permission & > constexpr dpp::permission::remove (T... values) noexcept remove dpp::permission::remove T... values

Remove a permission with the Bitwise NOT operation.

T

one or more uint64_t permission bits

values

The permissions (from dpp::permissions) to remove

Example:

    permission.remove(dpp::p_view_channel,dpp::p_send_messages);
    //Removesp_view_channelandp_send_messagespermission

permission& reference to self for chaining

typename... T T
std::enable_if_t<(std::is_convertible_v< T, uint64_t > &&...), permission & > constexpr std::enable_if_t<(std::is_convertible_v< T, uint64_t > &&...), permission & > constexpr dpp::permission::set (T... values) noexcept set dpp::permission::set T... values

Assign permissions. This will reset the bitmask to the new value.

T

one or more uint64_t permission bits

values

The permissions (from dpp::permissions) to set

Example:

    permission.set(dpp::p_view_channel,dpp::p_send_messages);

permission& reference to self for chaining

Represents a permission bitmask (refer to enum dpp::permissions) which are held in an uint64_t.

dpp::permission
value
uint64_t
- dpp::permission
  add
- dpp::permission
  can
- dpp::permission
  can_any
- dpp::permission
  has
- dpp::permission
  has_any
- dpp::permission
  operator uint64_t
- dpp::permission
  operator uint64_t &
- dpp::permission
  permission
- dpp::permission
  permission
- dpp::permission
  remove
- dpp::permission
  set
- dpp::permission
  value