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¶
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.
If the parent permission does not exist, it will be created and registered.
Parameters:
nameName of the parent permissionvalueThe 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.
Parameters:
permParent permission to register withvalueThe value to set this permission to
function 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¶
Gets the default value of this permission.
Returns:
Default value of this permission.
function getDescription¶
Gets a brief description of this permission, may be empty
Returns:
Brief description of this permission
function getName¶
Returns the unique fully qualified name of this Permission
Returns:
Fully qualified name
function getPermissibles¶
Gets a set containing every Permissible that has this permission. This set cannot be modified.
Returns:
Set containing permissibles with this permission
function init¶
function 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¶
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:
valueThe new default to set
function setDescription¶
Sets the description of this permission.
This will not be saved to disk, and is a temporary operation until the server reloads permissions.
Parameters:
valueThe new description to set
The documentation for this class was generated from the following file include/endstone/permissions/permission.h