public final class ActionPermission extends Object
The possible states are:
Modifier and Type | Method and Description |
---|---|
static Nomenclature<String> |
getActionPermissionNomenclature(Locale currentLocale) |
static ActionPermission |
getDisabled()
Factory method that specifies that an action is neither displayed to the user
nor can be executed by the user in the current session context.
|
static ActionPermission |
getDisabled(UserMessage aReason)
Factory method that specifies that an action is neither displayed to the user
nor can be executed by the user in the current session context.
|
UserMessage |
getDisabledReason()
Only defined if this state is set to 'disabled' and a specific reason is provided.
|
static ActionPermission |
getEnabled()
Factory method that specifies that an action may be executed
in the current session context.
|
char |
getFlag()
Persistent flag that identifies the permission.
|
String |
getFlagString()
Persistent flag that identifies the permission.
|
static ActionPermission |
getHidden()
Factory method that specifies that an action is neither displayed to the user
nor can be executed by the user in the current session context.
|
static ActionPermission |
getHidden(UserMessage aReason)
Factory method that specifies that an action is neither displayed to the user
nor can be executed by the user in the current session context.
|
static Nomenclature<String> |
getReadOnlyActionPermissionNomenclature(Locale currentLocale) |
boolean |
isDisabled() |
boolean |
isDisabledOrHidden()
This method returns the opposite of
isEnabled() . |
boolean |
isEnabled() |
boolean |
isHidden() |
boolean |
isSameFlag(String aFlagString)
Returns
true if the flag specified is the
same as the flag of this permission. |
ActionPermission |
max(ActionPermission anotherPermission)
Returns the least restrictive permission between this instance and the instance given
as an argument.
|
ActionPermission |
min(ActionPermission anotherPermission)
Returns the most restrictive permission between this instance and the instance given
as an argument.
|
static ActionPermission |
parseFlag(char accessFlag)
Factory method.
|
static ActionPermission |
parseFlag(String actionFlag)
Factory method.
|
String |
toDisplayString(Locale aLocale) |
String |
toString() |
public static ActionPermission getEnabled()
public static ActionPermission getDisabled()
getDisabled(UserMessage)
method.
In a future release, this state could be used to display the action to the user, but greyed out so that it cannot be executed.
public static ActionPermission getDisabled(UserMessage aReason)
In a future release, this state could be used to display the action to the user, but greyed out so that it cannot be executed.
public static ActionPermission getHidden()
getHidden(UserMessage)
method.public static ActionPermission getHidden(UserMessage aReason)
public boolean isEnabled()
getEnabled()
public boolean isDisabled()
getDisabled()
,
getDisabled(UserMessage)
public boolean isHidden()
getHidden()
public boolean isDisabledOrHidden()
isEnabled()
.public UserMessage getDisabledReason()
getDisabled(UserMessage)
public static ActionPermission parseFlag(String actionFlag)
getFlagString()
.public static ActionPermission parseFlag(char accessFlag)
getFlagString()
.public char getFlag()
public String getFlagString()
It returns the same content as getFlag()
.
public boolean isSameFlag(String aFlagString)
true
if the flag specified is the
same as the flag of this permission.public static Nomenclature<String> getActionPermissionNomenclature(Locale currentLocale)
public static Nomenclature<String> getReadOnlyActionPermissionNomenclature(Locale currentLocale)
public ActionPermission min(ActionPermission anotherPermission)
public ActionPermission max(ActionPermission anotherPermission)