Package com.orchestranetworks.service
Class ActionPermission
java.lang.Object
com.orchestranetworks.service.ActionPermission
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
Modifier and TypeMethodDescriptionstatic Nomenclature<String>
getActionPermissionNomenclature
(Locale currentLocale) static ActionPermission
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.Only defined if this state is set to 'disabled' and a specific reason is provided.static ActionPermission
Factory method that specifies that an action may be executed in the current session context.char
getFlag()
Persistent flag that identifies the permission.Persistent flag that identifies the permission.static ActionPermission
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
boolean
This method returns the opposite ofisEnabled()
.boolean
boolean
isHidden()
boolean
isSameFlag
(String aFlagString) Returnstrue
if the flag specified is the same as the flag of this permission.max
(ActionPermission anotherPermission) Returns the least restrictive permission between this instance and the instance given as an argument.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
Factory method.toDisplayString
(Locale aLocale) toString()
-
Method Details
-
getEnabled
Factory method that specifies that an action may be executed in the current session context. -
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
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
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
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. -
toString
-
isEnabled
public boolean isEnabled()- See Also:
-
isDisabled
public boolean isDisabled()- See Also:
-
isHidden
public boolean isHidden()- See Also:
-
isDisabledOrHidden
public boolean isDisabledOrHidden()This method returns the opposite ofisEnabled()
. -
getDisabledReason
Only defined if this state is set to 'disabled' and a specific reason is provided.- See Also:
-
parseFlag
Factory method. The argument specified can be obtained by calling the methodgetFlagString()
. -
parseFlag
Factory method. The argument specified can be obtained by calling the methodgetFlagString()
. -
getFlag
public char getFlag()Persistent flag that identifies the permission. -
getFlagString
Persistent flag that identifies the permission.It returns the same content as
getFlag()
. -
isSameFlag
Returnstrue
if the flag specified is the same as the flag of this permission. -
getActionPermissionNomenclature
-
toDisplayString
-
getReadOnlyActionPermissionNomenclature
-
min
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
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
-