Class PermissionNamespace
java.lang.Object
com.github.darksoulq.abyssallib.server.permission.PermissionNamespace
Provides a scoped container for registering permissions under a plugin-specific namespace.
-
Method Summary
Modifier and TypeMethodDescriptionvoidapply()Finalizes the registration process by adding all nodes to the AbyssalLib registry and the BukkitPluginManager.static PermissionNamespaceCreates a new namespace for a specific plugin.register(String path, Function<String, PermissionNode> supplier) Registers a new permission node within this namespace.
-
Method Details
-
create
Creates a new namespace for a specific plugin.- Parameters:
pluginId- The ID of the plugin.- Returns:
- A new PermissionNamespace instance.
-
register
Registers a new permission node within this namespace.- Parameters:
path- The sub-path (e.g., "admin.reload").supplier- A function that receives the full node string and returns a node builder.- Returns:
- A
Holderfor the registered node. - Throws:
IllegalStateException- If the path has already been registered.
-
apply
public void apply()Finalizes the registration process by adding all nodes to the AbyssalLib registry and the BukkitPluginManager.This method clears the pending entries map after execution.
-
getEntries
- Returns:
- An unmodifiable collection of all permission holders in this namespace.
-
getPluginId
- Returns:
- The plugin ID associated with this namespace.
-