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() constGets the Permissible that this is attached to
Returns:
Permissible containing this attachment
getPermissions
std::unordered_map<std::string, bool> getPermissions() constGets 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() constGets the plugin responsible for this attachment
Returns:
Plugin responsible for this permission attachment
getRemovalCallback
PermissionRemovedExecutor getRemovalCallback() constGets 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:
nameName of the permissionvalueNew value of the permission
void setPermission(Permission &perm, bool value)Sets a permission to the given value
Parameters:
permPermission to setvalueNew 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:
exExecutor 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:
nameName 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:
permPermission to remove