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 |
| virtual PermissionAttachment * | addAttachment (Plugin & plugin) = 0 |
| virtual CommandSender * | asCommandSender () const = 0 |
| virtual std::unordered_set< PermissionAttachmentInfo * > | getEffectivePermissions () const = 0 |
| virtual bool | hasPermission (std::string name) const = 0 |
| virtual bool | hasPermission (const Permission & perm) const = 0 |
| virtual bool | isOp () const = 0 Checks if this object is a server operator. |
| virtual bool | isPermissionSet (std::string name) const = 0 |
| virtual bool | isPermissionSet (const Permission & perm) const = 0 |
| virtual void | recalculatePermissions () = 0 |
| virtual bool | removeAttachment (PermissionAttachment & attachment) = 0 |
| virtual void | setOp (bool value) = 0 Sets the operator status of this object. |
| virtual | ~Permissible () = default |
Public Functions Documentation¶
function addAttachment [½]¶
virtual PermissionAttachment * endstone::Permissible::addAttachment (
Plugin & plugin,
const std::string & name,
bool value
) = 0
Adds a new PermissionAttachment with a single permission by name and value
Parameters:
pluginPlugin responsible for this attachment, may not be null or disablednameName of the permission to attachvalueValue 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¶
function getEffectivePermissions¶
virtual std::unordered_set< PermissionAttachmentInfo * > endstone::Permissible::getEffectivePermissions () const = 0
Gets a set containing all of the permissions currently in effect by this object
Returns:
Set of currently effective permissions
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 isOp¶
Checks if this object is a server operator.
Returns:
true if this is an operator, otherwise false
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
Parameters:
attachmentAttachment to remove
Returns:
true if the specified attachment was removed successfully, false when it isn't part of this object
function setOp¶
Sets the operator status of this object.
Parameters:
valueNew operator value
function ~Permissible¶
The documentation for this class was generated from the following file include/endstone/permissions/permissible.h