Interface CachedPermissionData

All Superinterfaces:
CachedData

public interface CachedPermissionData extends CachedData
Holds cached permission lookup data for a specific set of contexts.

All calls will account for inheritance, as well as any default data provided by the platform. These calls are heavily cached and are therefore fast.

  • Method Details

    • queryPermission

      @NonNull Result<Tristate,Node> queryPermission(@NonNull String permission)
      Performs a permission check for the given permission node.

      This check is equivalent to the "hasPermission" method call on most platforms. You can use Tristate.asBoolean() if you need a truthy result.

      Parameters:
      permission - the permission node
      Returns:
      a result containing the tristate
      Throws:
      NullPointerException - if permission is null
      Since:
      5.4
    • checkPermission

      default @NonNull Tristate checkPermission(@NonNull String permission)
      Performs a permission check for the given permission node.

      This check is equivalent to the "hasPermission" method call on most platforms. You can use Tristate.asBoolean() if you need a truthy result.

      Parameters:
      permission - the permission node
      Returns:
      a tristate result
      Throws:
      NullPointerException - if permission is null
    • invalidateCache

      void invalidateCache()
      Invalidates the underlying permission calculator cache.

      Can be called to allow for an update in defaults.

    • getPermissionMap

      @NonNull @Unmodifiable Map<String,Boolean> getPermissionMap()
      Gets an immutable copy of the permission map backing the permission calculator
      Returns:
      an immutable set of permissions