Skip to content

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 disabled
  • name Name of the permission to attach
  • value 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 .

virtual CommandSender * endstone::Permissible::asCommandSender () const = 0

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

virtual bool endstone::Permissible::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.

Parameters:

  • name Name of the permission

Returns:

Value of the permission


function hasPermission [2/2]

virtual bool endstone::Permissible::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.

Parameters:

Returns:

Value of the permission


function isOp

Checks if this object is a server operator.

virtual bool endstone::Permissible::isOp () const = 0

Returns:

true if this is an operator, otherwise false


function isPermissionSet [½]

virtual bool endstone::Permissible::isPermissionSet (
    std::string name
) const = 0

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]

virtual bool endstone::Permissible::isPermissionSet (
    const Permission & perm
) const = 0

Checks if this object contains an override for the specified Permission

Parameters:

Returns:

true if the permission is set, otherwise false


function recalculatePermissions

virtual void endstone::Permissible::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.


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.

virtual void endstone::Permissible::setOp (
    bool value
) = 0

Parameters:

  • value New operator value

function ~Permissible

virtual endstone::Permissible::~Permissible () = default


The documentation for this class was generated from the following file include/endstone/permissions/permissible.h