Interface PermissionContext


public interface PermissionContext
Immutable platform-neutral permission scope.

Replaces raw Map<String, String> and Bukkit-centric String world parameters in the modern API. The engine resolves checks through

invalid reference
dev.rono.permissions.api.runtime.ContextResolver
inheritance chains; it never assumes a world dimension exists.

  • Field Details

  • Method Details

    • attributes

      Map<String,String> attributes()
      Returns:
      immutable attribute map for this scope
    • get

      default Optional<String> get(String key)
      Returns the attribute value for key, if present and non-empty.
      Parameters:
      key - context key (for example WORLD)
      Returns:
      optional attribute value
    • global

      static PermissionContext global()
      Returns:
      global (empty) permission scope
    • of

      static PermissionContext of(Map<String,String> attributes)
      Builds a context from attribute map entries.
      Parameters:
      attributes - scope attributes; null or empty yields global()
      Returns:
      immutable context
    • server

      static PermissionContext server(String server)
      Parameters:
      server - backend or logical server id
    • world

      static PermissionContext world(String world)
      Parameters:
      world - loaded world or realm name
    • world

      static PermissionContext world(String server, String world)
      Parameters:
      server - logical server id
    • of

      static PermissionContext of(String world, String server, String region, String gamemode)
      Builds a context with the common world/server/region/gamemode keys.
      Parameters:
      world - realm or world name
      server - server name (proxy) or logical server id
      region - region name
      gamemode - gamemode name
      Returns:
      immutable context
    • withState

      static PermissionContext withState(String world, String state)
      Builds a context with world and optional STATE.
      Parameters:
      world - world or realm name
      state - optional state value
      Returns:
      immutable context
    • fromMap

      static PermissionContext fromMap(Map<String,String> legacy)
      Converts a legacy holder context map to PermissionContext.
      Parameters:
      legacy - context map from holder APIs; null yields global
      Returns:
      immutable context
    • toMap

      default Map<String,String> toMap()
      Returns a legacy map view for holder interop.
      Returns:
      immutable attribute map
    • isGlobal

      default boolean isGlobal()
      Returns:
      true when this context represents global scope