Enum Class Perms

java.lang.Object
java.lang.Enum<Perms>
net.minheur.potoflux.login.perms.Perms
All Implemented Interfaces:
Serializable, Comparable<Perms>, Constable

public enum Perms extends Enum<Perms>
Registers all perms of the app
  • Enum Constant Details

    • VIEW_USERS

      public static final Perms VIEW_USERS
      Perm required to view all users, as well as their account information.
    • CREATE_USERS

      public static final Perms CREATE_USERS
      Perm required to create new users
    • DELETE_USERS

      public static final Perms DELETE_USERS
      Perm required to delete accounts
    • CHANGE_INFORMATIONS

      public static final Perms CHANGE_INFORMATIONS
      Perm required to information of accounts.
      Require VIEW_USERS perm as well.
    • CHANGE_PASSWORD

      public static final Perms CHANGE_PASSWORD
      Perm required to reset users passwords, in case they forgot it.
      Require VIEW_USERS perm as well.
    • LOCK

      public static final Perms LOCK
      Perm required to lock accounts, disabling people to modify / delete it
    • LOCK_ACCOUNT_CREATION

      public static final Perms LOCK_ACCOUNT_CREATION
      Perm required to set if users are allowed to self-create an account
  • Method Details

    • values

      public static Perms[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Perms valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      @NotNull public @NotNull String getCode()
      Getter for the perm's SQL code
      Returns:
      the perm's SQL code
    • getName

      @NotNull public @NotNull String getName()
      Getter for the perm's name. It is built, getting the actual translated name.
      Returns:
      the perm's name
    • getPermAction

      @Nullable public @Nullable Runnable getPermAction()
      Getter for the perm's action.
      Returns:
      the perm's action
    • getNoRunFallback

      @Nullable public @Nullable String getNoRunFallback()
      Getter for the perm's fallback in case of no perm action.
      If not null, will be getting the actual translated sentence.
      Returns:
      the perm's fallback, or null if its supplier is
    • getFromCode

      @Nullable public static @Nullable Perms getFromCode(String sqlCode)
      Gets the Perms from an sqlCode.
      Used when listing perms sent by the database
      Parameters:
      sqlCode - the code to look the perm for
      Returns:
      the Perms corresponding to the code, null if not found
    • toString

      @NotNull public @NotNull String toString()
      Make sure we give the name.
      Used in combo boxes, to have an actual translated name
      Overrides:
      toString in class Enum<Perms>
      Returns:
      getName()