Package com.orchestranetworks.service
Class ActionPermission
- java.lang.Object
-
- com.orchestranetworks.service.ActionPermission
-
public final class ActionPermission extends Object
Defines the permissions for whether or not a user can execute an action.The possible states are:
- hidden – the action is not displayed to the user;
- disabled – the action is not displayed to the user (same as hidden). 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;
- enabled – the action is displayed and can be executed;
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Nomenclature<String>getActionPermissionNomenclature(Locale currentLocale)static ActionPermissiongetDisabled()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 ActionPermissiongetDisabled(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.UserMessagegetDisabledReason()Only defined if this state is set to 'disabled' and a specific reason is provided.static ActionPermissiongetEnabled()Factory method that specifies that an action may be executed in the current session context.chargetFlag()Persistent flag that identifies the permission.StringgetFlagString()Persistent flag that identifies the permission.static ActionPermissiongetHidden()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 ActionPermissiongetHidden(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)booleanisDisabled()booleanisDisabledOrHidden()This method returns the opposite ofisEnabled().booleanisEnabled()booleanisHidden()booleanisSameFlag(String aFlagString)Returnstrueif the flag specified is the same as the flag of this permission.ActionPermissionmax(ActionPermission anotherPermission)Returns the least restrictive permission between this instance and the instance given as an argument.ActionPermissionmin(ActionPermission anotherPermission)Returns the most restrictive permission between this instance and the instance given as an argument.static ActionPermissionparseFlag(char accessFlag)Factory method.static ActionPermissionparseFlag(String actionFlag)Factory method.StringtoDisplayString(Locale aLocale)StringtoString()
-
-
-
Method Detail
-
getEnabled
public static ActionPermission getEnabled()
Factory method that specifies that an action may be executed in the current session context.
-
getDisabled
public 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. This method does not provide a reason for this restriction. To specify a reason, use thegetDisabled(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.
-
getDisabled
public 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. This method allows to provide a reason for this restriction.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.
-
getHidden
public 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. This method does not provide a reason for this restriction. To specify a reason, use thegetHidden(UserMessage)method.
-
getHidden
public 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. This method allows to provide a reason for this restriction.
-
isEnabled
public boolean isEnabled()
- See Also:
getEnabled()
-
isDisabled
public boolean isDisabled()
- See Also:
getDisabled(),getDisabled(UserMessage)
-
isHidden
public boolean isHidden()
- See Also:
getHidden()
-
isDisabledOrHidden
public boolean isDisabledOrHidden()
This method returns the opposite ofisEnabled().
-
getDisabledReason
public UserMessage getDisabledReason()
Only defined if this state is set to 'disabled' and a specific reason is provided.- See Also:
getDisabled(UserMessage)
-
parseFlag
public static ActionPermission parseFlag(String actionFlag)
Factory method. The argument specified can be obtained by calling the methodgetFlagString().
-
parseFlag
public static ActionPermission parseFlag(char accessFlag)
Factory method. The argument specified can be obtained by calling the methodgetFlagString().
-
getFlag
public char getFlag()
Persistent flag that identifies the permission.
-
getFlagString
public String getFlagString()
Persistent flag that identifies the permission.It returns the same content as
getFlag().
-
isSameFlag
public boolean isSameFlag(String aFlagString)
Returnstrueif the flag specified is the same as the flag of this permission.
-
getActionPermissionNomenclature
public static Nomenclature<String> getActionPermissionNomenclature(Locale currentLocale)
-
getReadOnlyActionPermissionNomenclature
public static Nomenclature<String> getReadOnlyActionPermissionNomenclature(Locale currentLocale)
-
min
public ActionPermission min(ActionPermission anotherPermission)
Returns the most restrictive permission between this instance and the instance given as an argument. When two permissions has the same value, priority is given to the one having a more severe reason if specified.- Since:
- 5.7.0
-
max
public ActionPermission max(ActionPermission anotherPermission)
Returns the least restrictive permission between this instance and the instance given as an argument. When two permissions has the same value, priority is given to the one having a more severe reason if specified.- Since:
- 5.7.0
-
-