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
const PermissionDefault 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)
void addParent (Permission & perm, bool value) const
std::unordered_map< std::string, bool > & getChildren ()
PermissionDefault getDefault () const
std::string getDescription () const
std::string getName () const
std::unordered_set< Permissible * > getPermissibles () const
void init (PluginManager & plugin_manager)
void recalculatePermissibles ()
void setDefault (PermissionDefault value)
void setDescription (std::string value)

Public Static Attributes Documentation

variable DefaultPermission

const PermissionDefault 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 [½]

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

Adds this permission to the specified parent permission.

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]

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

Adds this permission to the specified parent permission.

Parameters:

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

function getChildren

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

Gets the children of this permission. If you change this map in any form, you must call recalculatePermissibles() to recalculate all Permissibles

Returns:

Permission children


function getDefault

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

Gets the default value of this permission.

Returns:

Default value of this permission.


function getDescription

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

Gets a brief description of this permission, may be empty

Returns:

Brief description of this permission


function getName

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

Returns the unique fully qualified name of this Permission

Returns:

Fully qualified name


function getPermissibles

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

Gets a set containing every Permissible that has this permission. This set cannot be modified.

Returns:

Set containing permissibles with this permission


function init

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

function recalculatePermissibles

inline void endstone::Permission::recalculatePermissibles () 

Recalculates all Permissibles that contain this permission.

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


function setDefault

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

Sets the default value of this permission.

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

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

Sets the description of this permission.

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