Interface PermissionManager

All Known Subinterfaces:
PluginManager
All Known Implementing Classes:
SimplePluginManager

@Experimental @NullMarked public interface PermissionManager
A permission manager implementation to keep backwards compatibility partially alive with existing plugins that used the bukkit one before.
  • Method Details

    • getPermission

      @Nullable Permission getPermission(String name)
      Gets a Permission from its fully qualified name
      Parameters:
      name - Name of the permission
      Returns:
      Permission, or null if none
    • addPermission

      void addPermission(Permission perm)
      Adds a Permission to this plugin manager.

      If a permission is already defined with the given name of the new permission, an exception will be thrown.

      Parameters:
      perm - Permission to add
      Throws:
      IllegalArgumentException - Thrown when a permission with the same name already exists
    • removePermission

      void removePermission(Permission perm)
      Removes a Permission registration from this plugin manager.

      If the specified permission does not exist in this plugin manager, nothing will happen.

      Removing a permission registration will not remove the permission from any Permissibles that have it.

      Parameters:
      perm - Permission to remove
    • removePermission

      void removePermission(String name)
      Removes a Permission registration from this plugin manager.

      If the specified permission does not exist in this plugin manager, nothing will happen.

      Removing a permission registration will not remove the permission from any Permissibles that have it.

      Parameters:
      name - Permission to remove
    • getDefaultPermissions

      Set<Permission> getDefaultPermissions(boolean op)
      Gets the default permissions for the given op status
      Parameters:
      op - Which set of default permissions to get
      Returns:
      The default permissions
    • recalculatePermissionDefaults

      void recalculatePermissionDefaults(Permission perm)
      Recalculates the defaults for the given Permission.

      This will have no effect if the specified permission is not registered here.

      Parameters:
      perm - Permission to recalculate
    • subscribeToPermission

      void subscribeToPermission(String permission, Permissible permissible)
      Subscribes the given Permissible for information about the requested Permission, by name.

      If the specified Permission changes in any form, the Permissible will be asked to recalculate.

      Parameters:
      permission - Permission to subscribe to
      permissible - Permissible subscribing
    • unsubscribeFromPermission

      void unsubscribeFromPermission(String permission, Permissible permissible)
      Unsubscribes the given Permissible for information about the requested Permission, by name.
      Parameters:
      permission - Permission to unsubscribe from
      permissible - Permissible subscribing
    • getPermissionSubscriptions

      Set<Permissible> getPermissionSubscriptions(String permission)
      Gets a set containing all subscribed Permissibles to the given permission, by name
      Parameters:
      permission - Permission to query for
      Returns:
      Set containing all subscribed permissions
    • subscribeToDefaultPerms

      void subscribeToDefaultPerms(boolean op, Permissible permissible)
      Subscribes to the given Default permissions by operator status

      If the specified defaults change in any form, the Permissible will be asked to recalculate.

      Parameters:
      op - Default list to subscribe to
      permissible - Permissible subscribing
    • unsubscribeFromDefaultPerms

      void unsubscribeFromDefaultPerms(boolean op, Permissible permissible)
      Unsubscribes from the given Default permissions by operator status
      Parameters:
      op - Default list to unsubscribe from
      permissible - Permissible subscribing
    • getDefaultPermSubscriptions

      Set<Permissible> getDefaultPermSubscriptions(boolean op)
      Gets a set containing all subscribed Permissibles to the given default list, by op status
      Parameters:
      op - Default list to query for
      Returns:
      Set containing all subscribed permissions
    • getPermissions

      Set<Permission> getPermissions()
      Gets a set of all registered permissions.

      This set is a copy and will not be modified live.

      Returns:
      Set containing all current registered permissions
    • addPermissions

      void addPermissions(List<Permission> perm)
      Adds a list of permissions.

      This is meant as an optimization for adding multiple permissions without recalculating each permission.

      Parameters:
      perm - permission
    • clearPermissions

      void clearPermissions()
      Clears the current registered permissinos.

      This is used for reloading.