Package net.minheur.potoflux.login.perms
Enum Class Perms
- All Implemented Interfaces:
Serializable,Comparable<Perms>,Constable
Registers all perms of the app
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionPerm required to information of accounts.
RequireVIEW_USERSperm as well.Perm required to reset users passwords, in case they forgot it.
RequireVIEW_USERSperm as well.Perm required to create new usersPerm required to delete accountsPerm required to lock accounts, disabling people to modify / delete itPerm required to set if users are allowed to self-create an accountPerm required to view all users, as well as their account information. -
Method Summary
Modifier and TypeMethodDescription@NotNull StringgetCode()Getter for the perm's SQL codestatic @Nullable PermsgetFromCode(String sqlCode) Gets thePermsfrom an sqlCode.
Used when listing perms sent by the database@NotNull StringgetName()Getter for the perm's name.@Nullable StringGetter for the perm's fallback in case of no perm action.
If not null, will be getting the actual translated sentence.@Nullable RunnableGetter for the perm's action.@NotNull StringtoString()Make sure we give the name.
Used in combo boxes, to have an actual translated namestatic PermsReturns the enum constant of this class with the specified name.static Perms[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
VIEW_USERS
Perm required to view all users, as well as their account information. -
CREATE_USERS
Perm required to create new users -
DELETE_USERS
Perm required to delete accounts -
CHANGE_INFORMATIONS
Perm required to information of accounts.
RequireVIEW_USERSperm as well. -
CHANGE_PASSWORD
Perm required to reset users passwords, in case they forgot it.
RequireVIEW_USERSperm as well. -
LOCK
Perm required to lock accounts, disabling people to modify / delete it -
LOCK_ACCOUNT_CREATION
Perm required to set if users are allowed to self-create an account
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getCode
Getter for the perm's SQL code- Returns:
- the perm's SQL code
-
getName
Getter for the perm's name. It is built, getting the actual translated name.- Returns:
- the perm's name
-
getPermAction
Getter for the perm's action.- Returns:
- the perm's action
-
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
Gets thePermsfrom an sqlCode.
Used when listing perms sent by the database- Parameters:
sqlCode- the code to look the perm for- Returns:
- the
Permscorresponding to the code,nullif not found
-
toString
Make sure we give the name.
Used in combo boxes, to have an actual translated name
-