endstone::PermissionAttachment
Holds information about a permission attachment on a Permissible object.
Functions:
Name | Description |
---|---|
PermissionAttachment | |
getPermissible | |
getPermissions | |
getPlugin | |
getRemovalCallback | |
remove | |
setPermission | |
setPermission | |
setRemovalCallback | |
unsetPermission | |
unsetPermission |
PermissionAttachment
PermissionAttachment(Plugin &plugin, Permissible &permissible)
getPermissible
Permissible &getPermissible() const
Gets the Permissible that this is attached to
Returns:
Permissible containing this attachment
getPermissions
std::unordered_map<std::string, bool> 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
getPlugin
Plugin &getPlugin() const
Gets the plugin responsible for this attachment
Returns:
Plugin responsible for this permission attachment
getRemovalCallback
PermissionRemovedExecutor 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
remove
bool remove()
Removes this attachment from its registered Permissible
Returns:
true if the permissible was removed successfully, false if it did not exist
setPermission
void setPermission(std::string name, bool value)
Sets a permission to the given value, by its fully qualified name
Parameters:
name
Name of the permissionvalue
New value of the permission
void setPermission(Permission &perm, bool value)
Sets a permission to the given value
Parameters:
perm
Permission to setvalue
New value of the permission
setRemovalCallback
void 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
unsetPermission
void 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
void unsetPermission(Permission &perm)
Removes the specified permission from this attachment. If the permission does not exist in this attachment, nothing will happen.
Parameters:
perm
Permission to remove