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

  Modifier and Type
  Method
  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()`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### 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 the `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.

  - ### 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 the `getHidden(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.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### 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 of `isEnabled()`.

  - ### 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 method `getFlagString()`.

  - ### parseFlag

    public static ActionPermission parseFlag(char accessFlag)
    Factory method. The argument specified can be obtained by calling the method `getFlagString()`.

  - ### 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)
    Returns `true` if the flag specified is the same as the flag of this permission.

  - ### getActionPermissionNomenclature

    public static Nomenclature<String> getActionPermissionNomenclature(Locale currentLocale)

  - ### toDisplayString

    public String toDisplayString(Locale aLocale)

  - ### 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