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
inheritance chains; it never assumes a world dimension exists.invalid reference
dev.rono.permissions.api.runtime.ContextResolver
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PermissionContextConverts a legacy holder context map toPermissionContext.Returns the attribute value forkey, if present and non-empty.static PermissionContextglobal()default booleanisGlobal()static PermissionContextBuilds a context with the common world/server/region/gamemode keys.static PermissionContextBuilds a context from attribute map entries.static PermissionContexttoMap()Returns a legacy map view for holder interop.static PermissionContextBuilds a context with world and optionalSTATE.static PermissionContextstatic PermissionContext
-
Field Details
-
SERVER
- See Also:
-
WORLD
- See Also:
-
DIMENSION
- See Also:
-
REGION
- See Also:
-
GAMEMODE
- See Also:
-
STATE
Optional state scope (for example"event"during minigames).- See Also:
-
-
Method Details
-
attributes
- Returns:
- immutable attribute map for this scope
-
get
Returns the attribute value forkey, if present and non-empty.- Parameters:
key- context key (for exampleWORLD)- Returns:
- optional attribute value
-
global
- Returns:
- global (empty) permission scope
-
of
Builds a context from attribute map entries.- Parameters:
attributes- scope attributes;nullor empty yieldsglobal()- Returns:
- immutable context
-
server
- Parameters:
server- backend or logical server id
-
world
- Parameters:
world- loaded world or realm name
-
world
- Parameters:
server- logical server id
-
of
Builds a context with the common world/server/region/gamemode keys.- Parameters:
world- realm or world nameserver- server name (proxy) or logical server idregion- region namegamemode- gamemode name- Returns:
- immutable context
-
withState
Builds a context with world and optionalSTATE.- Parameters:
world- world or realm namestate- optional state value- Returns:
- immutable context
-
fromMap
Converts a legacy holder context map toPermissionContext.- Parameters:
legacy- context map from holder APIs;nullyields global- Returns:
- immutable context
-
toMap
Returns a legacy map view for holder interop.- Returns:
- immutable attribute map
-
isGlobal
default boolean isGlobal()- Returns:
truewhen this context represents global scope
-