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
std::unordered_map< std::string, bool > getPermissions () const
Plugin & getPlugin () const
PermissionRemovedExecutor getRemovalCallback () const
bool remove ()
void setPermission (std::string name, bool value)
void setPermission (Permission & perm, bool value)
void setRemovalCallback (PermissionRemovedExecutor ex)
void unsetPermission (std::string name)
void unsetPermission (Permission & perm)

Public Functions Documentation

function PermissionAttachment

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

function getPermissible

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

Gets the Permissible that this is attached to

Returns:

Permissible containing this attachment


function getPermissions

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

Gets a copy of all set permissions and values contained within this attachment. 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

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

Gets the plugin responsible for this attachment

Returns:

Plugin responsible for this permission attachment


function getRemovalCallback

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

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

Returns:

Executor to be called when this is removed


function remove

inline bool endstone::PermissionAttachment::remove () 

Removes this attachment from its registered Permissible

Returns:

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


function setPermission [½]

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

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

Parameters:

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

function setPermission [2/2]

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

Sets a permission to the given value

Parameters:

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

function setRemovalCallback

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

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

Parameters:

  • ex Executor to be called when this is removed

function unsetPermission [½]

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

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

Parameters:

  • name Name of the permission to remove

function unsetPermission [2/2]

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

Removes the specified permission from this attachment. 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