Skip to content

Class endstone::Permission

ClassList > endstone > Permission

Represents a unique permission that may be attached to a Permissible .

  • #include <endstone/permissions/permission.h>

Public Static Attributes

Type Name
constexpr auto DefaultPermission = PermissionDefault::Operator

Public Functions

Type Name
Permission (std::string name, std::string description="", PermissionDefault default_value=DefaultPermission, std::unordered_map< std::string, bool > children={})
Permission * addParent (std::string name, bool value)
Adds this permission to the specified parent permission.
void addParent (Permission & perm, bool value) const
Adds this permission to the specified parent permission.
std::unordered_map< std::string, bool > & getChildren ()
Gets the children of this permission.
PermissionDefault getDefault () const
Gets the default value of this permission.
std::string getDescription () const
Gets a brief description of this permission, may be empty.
std::string getName () const
Returns the unique fully qualified name of this Permission .
std::unordered_set< Permissible * > getPermissibles () const
Gets a set containing every Permissible that has this permission.
void init (PluginManager & plugin_manager)
void recalculatePermissibles ()
Recalculates all Permissibles that contain this permission.
void setDefault (PermissionDefault value)
Sets the default value of this permission.
void setDescription (std::string value)
Sets the description of this permission.

Public Static Attributes Documentation

variable DefaultPermission

constexpr auto endstone::Permission::DefaultPermission;

Public Functions Documentation

function Permission

inline explicit endstone::Permission::Permission (
    std::string name,
    std::string description="",
    PermissionDefault default_value=DefaultPermission,
    std::unordered_map< std::string, bool > children={}
) 

function addParent [½]

Adds this permission to the specified parent permission.

inline Permission * endstone::Permission::addParent (
    std::string name,
    bool value
) 

If the parent permission does not exist, it will be created and registered.

Parameters:

  • name Name of the parent permission
  • value The value to set this permission to

Returns:

Parent permission it created or loaded


function addParent [2/2]

Adds this permission to the specified parent permission.

inline void endstone::Permission::addParent (
    Permission & perm,
    bool value
) const

Parameters:

  • perm Parent permission to register with
  • value The value to set this permission to

function getChildren

Gets the children of this permission.

inline std::unordered_map< std::string, bool > & endstone::Permission::getChildren () 

If you change this map in any form, you must call recalculatePermissibles() to recalculate all Permissibles.

Returns:

Permission children


function getDefault

Gets the default value of this permission.

inline PermissionDefault endstone::Permission::getDefault () const

Returns:

Default value of this permission.


function getDescription

Gets a brief description of this permission, may be empty.

inline std::string endstone::Permission::getDescription () const

Returns:

Brief description of this permission


function getName

Returns the unique fully qualified name of this Permission .

inline std::string endstone::Permission::getName () const

Returns:

Fully qualified name


function getPermissibles

Gets a set containing every Permissible that has this permission.

inline std::unordered_set< Permissible * > endstone::Permission::getPermissibles () const

This set cannot be modified.

Returns:

Set containing permissibles with this permission


function init

inline void endstone::Permission::init (
    PluginManager & plugin_manager
) 

function recalculatePermissibles

Recalculates all Permissibles that contain this permission.

inline void endstone::Permission::recalculatePermissibles () 

This should be called after modifying the children, and is automatically called after modifying the default value


function setDefault

Sets the default value of this permission.

inline void endstone::Permission::setDefault (
    PermissionDefault value
) 

This will not be saved to disk, and is a temporary operation until the server reloads permissions. Changing this default will cause all Permissibles that contain this permission to recalculate their permissions

Parameters:

  • value The new default to set

function setDescription

Sets the description of this permission.

inline void endstone::Permission::setDescription (
    std::string value
) 

This will not be saved to disk, and is a temporary operation until the server reloads permissions.

Parameters:

  • value The new description to set


The documentation for this class was generated from the following file include/endstone/permissions/permission.h