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 Result< PermissionAttachment * > | addAttachment (Plugin & plugin, const std::string & name, bool value) = 0 |
virtual Result< PermissionAttachment * > | addAttachment (Plugin & plugin) = 0 |
virtual CommandSender * | asCommandSender () const = 0 Casts a Permissible asCommandSender . |
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 Result< void > | 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 Result< 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:
plugin
Plugin responsible for this attachment, may not be null or disabledname
Name of the permission to attachvalue
Value of the permission
Returns:
The PermissionAttachment that was just created
function addAttachment [2/2]¶
virtual Result< PermissionAttachment * > endstone::Permissible::addAttachment (
Plugin & plugin
) = 0
Adds a new empty PermissionAttachment to this object
Parameters:
plugin
Plugin 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¶
virtual std::unordered_set< PermissionAttachmentInfo * > endstone::Permissible::getEffectivePermissions () const = 0
Gets a set containing all 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:
name
Name 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:
perm
Permission 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:
name
Name 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:
perm
Permission 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¶
virtual Result< void > endstone::Permissible::removeAttachment (
PermissionAttachment & attachment
) = 0
Removes the given PermissionAttachment from this object
Parameters:
attachment
Attachment 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:
value
New operator value
function ~Permissible¶
The documentation for this class was generated from the following file include/endstone/permissions/permissible.h