Class endstone::Permissible¶
ClassList > endstone > Permissible
Represents an object that may become a server operator and can be assigned permissions.
- #include <endstone/permissions/permissible.h>
Inherited by the following classes: endstone::CommandSender
Public Functions¶
| Type | Name | 
|---|---|
| virtual PermissionAttachment * | addAttachment (Plugin & plugin, const std::string & name, bool value) = 0 Adds a new PermissionAttachment with a single permission by name and value. | 
| virtual PermissionAttachment * | addAttachment (Plugin & plugin) = 0 Adds a new empty PermissionAttachment to this object. | 
| virtual CommandSender * | asCommandSender () const = 0 Casts a Permissible asCommandSender . | 
| virtual std::unordered_set< PermissionAttachmentInfo * > | getEffectivePermissions () const = 0 Gets a set containing all the permissions currently in effect by this object. | 
| virtual PermissionLevel | getPermissionLevel () const = 0 Gets the permission level of this object. | 
| virtual bool | hasPermission (std::string name) const = 0 Gets the value of the specified permission, if set. If a permission override is not set on this object, the default value of the permission will be returned. | 
| virtual bool | hasPermission (const Permission & perm) const = 0 Gets the value of the specified permission, if set. If a permission override is not set on this object, the default value of the permission will be returned. | 
| virtual bool | isPermissionSet (std::string name) const = 0 Checks if this object contains an override for the specified permission, by fully qualified name. | 
| virtual bool | isPermissionSet (const Permission & perm) const = 0 Checks if this object contains an override for the specified Permission . | 
| virtual void | recalculatePermissions () = 0 Recalculates the permissions for this object, if the attachments have changed values. This should very rarely need to be called from a plugin. | 
| virtual Result< void > | removeAttachment (PermissionAttachment & attachment) = 0 Removes the given PermissionAttachment from this object. | 
| virtual | ~Permissible () = default | 
Public Functions Documentation¶
function addAttachment [½]¶
Adds a new PermissionAttachment with a single permission by name and value.
virtual PermissionAttachment * endstone::Permissible::addAttachment (
    Plugin & plugin,
    const std::string & name,
    bool value
) = 0
Parameters:
- pluginPlugin responsible for this attachment, may not be null or disabled
- nameName of the permission to attach
- valueValue of the permission
Returns:
The PermissionAttachment that was just created
function addAttachment [2/2]¶
Adds a new empty PermissionAttachment to this object.
Parameters:
- pluginPlugin responsible for this attachment, may not be null or disabled
Returns:
The PermissionAttachment that was just created
function asCommandSender¶
Casts a Permissible asCommandSender .
Returns:
CommandSender, nullptr if not a CommandSender
function getEffectivePermissions¶
Gets a set containing all the permissions currently in effect by this object.
virtual std::unordered_set< PermissionAttachmentInfo * > endstone::Permissible::getEffectivePermissions () const = 0
Returns:
Set of currently effective permissions
function getPermissionLevel¶
Gets the permission level of this object.
Returns:
The permission level
function hasPermission [½]¶
Gets the value of the specified permission, if set. If a permission override is not set on this object, the default value of the permission will be returned.
Parameters:
- nameName of the permission
Returns:
Value of the permission
function hasPermission [2/2]¶
Gets the value of the specified permission, if set. If a permission override is not set on this object, the default value of the permission will be returned.
Parameters:
- permPermission to get
Returns:
Value of the permission
function isPermissionSet [½]¶
Checks if this object contains an override for the specified permission, by fully qualified name.
Parameters:
- nameName of the permission
Returns:
true if the permission is set, otherwise false
function isPermissionSet [2/2]¶
Checks if this object contains an override for the specified Permission .
Parameters:
- permPermission to check
Returns:
true if the permission is set, otherwise false
function recalculatePermissions¶
Recalculates the permissions for this object, if the attachments have changed values. This should very rarely need to be called from a plugin.
function removeAttachment¶
Removes the given PermissionAttachment from this object.
virtual Result< void > endstone::Permissible::removeAttachment (
    PermissionAttachment & attachment
) = 0
Parameters:
- attachmentAttachment to remove
Returns:
true if the specified attachment was removed successfully, false when it isn't part of this object
function ~Permissible¶
The documentation for this class was generated from the following file include/endstone/permissions/permissible.h