Interface Permission

All Known Implementing Classes:
PermissionProvider

public sealed interface Permission permits PermissionProvider
Permission interface to manage permissions.
  • Method Summary

    Modifier and Type
    Method
    Description
    getPermissions(int userId)
    Retrieves a list of permissions for a user based on their user ID.
    boolean
    hasPermission(int userId, String permission)
    Checks if a user identified by their unique user ID has a specific permission.
    boolean
    hasPermission(UUID uuid, String permission)
    Checks if a user identified by their unique UUID has a specific permission.
    void
    Reloads or refreshes any expired entities or permissions within the system.
  • Method Details

    • getPermissions

      List<String> getPermissions(int userId)
      Retrieves a list of permissions for a user based on their user ID. This includes both the user's direct permissions and those inherited from parent entities.
      Parameters:
      userId - The unique identifier of the user whose permissions are to be retrieved.
      Returns:
      A list of all permissions applicable to the specified user.
    • loadExpired

      void loadExpired()
      Reloads or refreshes any expired entities or permissions within the system. This method is intended to invoke expiration-related updates for underlying group and user components.
    • hasPermission

      boolean hasPermission(UUID uuid, String permission)
      Checks if a user identified by their unique UUID has a specific permission.
      Parameters:
      uuid - The universally unique identifier (UUID) of the user.
      permission - The permission string to check for the user.
      Returns:
      true if the user has the specified permission, otherwise false.
    • hasPermission

      boolean hasPermission(int userId, String permission)
      Checks if a user identified by their unique user ID has a specific permission.
      Parameters:
      userId - The unique identifier of the user to check permissions for.
      permission - The specific permission string to verify for the user.
      Returns:
      true if the user has the specified permission, otherwise false.