Class PermissionControl
Honesty contract: grant(java.lang.String), revoke(java.lang.String), and unset(java.lang.String) mutate LightKeeper's own
PermissionAttachment on the synthetic player. This bypasses permission plugins such as
LuckPerms — the mutation is real as far as Bukkit's permission resolution is concerned, but no permission plugin
observes it. For permission-plugin-realistic tests, drive the plugin itself instead (e.g. console
lp user ... permission set ... commands).
has(String) is a live query: every call asks the server for the player's current
hasPermission result, which reflects all permission sources (attachments, permission plugins, defaults,
and OP status) — not just LightKeeper's own attachment.
-
Method Summary
Modifier and TypeMethodDescriptionGrants a permission node by setting it totrueon the player's attachment.booleanQueries the live value of a permission node for this player.Revokes a permission node by setting it tofalseon the player's attachment.Removes a permission node from the player's attachment, restoring the player's default for that node.
-
Method Details
-
grant
Grants a permission node by setting it totrueon the player's attachment.- Parameters:
permission- The permission node to grant.- Returns:
- This handle for fluent chaining.
-
revoke
Revokes a permission node by setting it tofalseon the player's attachment.Unlike
unset(String), this overrides the node's default and any grant on LightKeeper's own attachment. Grants applied by other attachments (e.g. a permission plugin's) may still win, depending on Bukkit's attachment resolution order.- Parameters:
permission- The permission node to revoke.- Returns:
- This handle for fluent chaining.
-
unset
Removes a permission node from the player's attachment, restoring the player's default for that node.A no-op when the node was never granted or revoked through this handle (or at spawn time).
- Parameters:
permission- The permission node to remove from the attachment.- Returns:
- This handle for fluent chaining.
-
has
Queries the live value of a permission node for this player.- Parameters:
permission- The permission node to query.- Returns:
- The player's current
hasPermissionresult on the server.
-