Class PermissionNamespace

java.lang.Object
com.github.darksoulq.abyssallib.server.permission.PermissionNamespace

public class PermissionNamespace extends Object
Provides a scoped container for registering permissions under a plugin-specific namespace.
  • Method Details

    • create

      public static PermissionNamespace create(String pluginId)
      Creates a new namespace for a specific plugin.
      Parameters:
      pluginId - The ID of the plugin.
      Returns:
      A new PermissionNamespace instance.
    • register

      public PermissionNode register(String path, Function<String, PermissionNode> supplier)
      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 Holder for 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 Bukkit PluginManager.

      This method clears the pending entries map after execution.

    • getEntries

      public Collection<PermissionNode> getEntries()
      Returns:
      An unmodifiable collection of all permission holders in this namespace.
    • getPluginId

      public String getPluginId()
      Returns:
      The plugin ID associated with this namespace.