Skip to content

Class endstone::PermissionAttachment

ClassList > endstone > PermissionAttachment

Holds information about a permission attachment on a Permissible object.

  • #include <endstone/permissions/permission_attachment.h>

Public Functions

Type Name
PermissionAttachment (Plugin & plugin, Permissible & permissible)
Permissible & getPermissible () const
Gets the Permissible that this is attached to.
std::unordered_map< std::string, bool > getPermissions () const
Gets a copy of all set permissions and values contained within this attachment.
Plugin & getPlugin () const
Gets the plugin responsible for this attachment.
PermissionRemovedExecutor getRemovalCallback () const
Gets the executor that was previously set to be called when this attachment was removed from a Permissible .
bool remove ()
Removes this attachment from its registered Permissible .
void setPermission (std::string name, bool value)
Sets a permission to the given value, by its fully qualified name.
void setPermission (Permission & perm, bool value)
Sets a permission to the given value.
void setRemovalCallback (PermissionRemovedExecutor ex)
Sets an executor to be called for when this attachment is removed from a Permissible .
void unsetPermission (std::string name)
Removes the specified permission from this attachment.
void unsetPermission (Permission & perm)
Removes the specified permission from this attachment.

Public Functions Documentation

function PermissionAttachment

inline endstone::PermissionAttachment::PermissionAttachment (
    Plugin & plugin,
    Permissible & permissible
) 

function getPermissible

Gets the Permissible that this is attached to.

inline Permissible & endstone::PermissionAttachment::getPermissible () const

Returns:

Permissible containing this attachment


function getPermissions

Gets a copy of all set permissions and values contained within this attachment.

inline std::unordered_map< std::string, bool > endstone::PermissionAttachment::getPermissions () const

This map may be modified but will not affect the attachment, as it is a copy.

Returns:

Copy of all permissions and values expressed by this attachment


function getPlugin

Gets the plugin responsible for this attachment.

inline Plugin & endstone::PermissionAttachment::getPlugin () const

Returns:

Plugin responsible for this permission attachment


function getRemovalCallback

Gets the executor that was previously set to be called when this attachment was removed from a Permissible .

inline PermissionRemovedExecutor endstone::PermissionAttachment::getRemovalCallback () const

May be empty.

Returns:

Executor to be called when this is removed


function remove

Removes this attachment from its registered Permissible .

inline bool endstone::PermissionAttachment::remove () 

Returns:

true if the permissible was removed successfully, false if it did not exist


function setPermission [½]

Sets a permission to the given value, by its fully qualified name.

inline void endstone::PermissionAttachment::setPermission (
    std::string name,
    bool value
) 

Parameters:

  • name Name of the permission
  • value New value of the permission

function setPermission [2/2]

Sets a permission to the given value.

inline void endstone::PermissionAttachment::setPermission (
    Permission & perm,
    bool value
) 

Parameters:

  • perm Permission to set
  • value New value of the permission

function setRemovalCallback

Sets an executor to be called for when this attachment is removed from a Permissible .

inline void endstone::PermissionAttachment::setRemovalCallback (
    PermissionRemovedExecutor ex
) 

May be empty.

Parameters:

  • ex Executor to be called when this is removed

function unsetPermission [½]

Removes the specified permission from this attachment.

inline void endstone::PermissionAttachment::unsetPermission (
    std::string name
) 

If the permission does not exist in this attachment, nothing will happen.

Parameters:

  • name Name of the permission to remove

function unsetPermission [2/2]

Removes the specified permission from this attachment.

inline void endstone::PermissionAttachment::unsetPermission (
    Permission & perm
) 

If the permission does not exist in this attachment, nothing will happen.

Parameters:



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