Package com.orchestranetworks.userservice.permission

# Class UserServicePermission

java.lang.Object
com.orchestranetworks.userservice.permission.UserServicePermission

public final class UserServicePermission extends Object
Defines the permission for whether or not a user can display or execute a user service.

The possible states are:

- enabled – the service is displayed or can be executed;
- disabled – the service is not displayed or cannot be executed;

Since:
  5.8.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static UserServicePermission`
  `getDisabled()`
  Factory method that specifies that a user service can not be displayed or executed in the current session context.
  `static UserServicePermission`
  `getDisabled(UserMessage aReason)`
  Factory method that specifies that a user service can not be displayed or executed in the current session context.
  `UserMessage`
  `getDisabledReason()`
  Only defined if this state is set to 'disabled' and a specific reason is provided.
  `static UserServicePermission`
  `getEnabled()`
  Factory method that specifies that a user service can be displayed or executed in the current session context.
  `char`
  `getFlag()`
  Persistent flag that identifies the permission.
  `String`
  `getFlagString()`
  Persistent flag that identifies the permission.
  `boolean`
  `isDisabled()`
  `boolean`
  `isEnabled()`
  `boolean`
  `isSameFlag(String aFlagString)`
  Returns `true` if the flag specified is the same as the flag of this permission.
  `UserServicePermission`
  `max(UserServicePermission anotherPermission)`
  Returns the least restrictive permission between this instance and the instance given as an argument.
  `UserServicePermission`
  `min(UserServicePermission anotherPermission)`
  Returns the most restrictive permission between this instance and the instance given as an argument.
  `static UserServicePermission`
  `parseFlag(char accessFlag)`
  Factory method.
  `static UserServicePermission`
  `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 UserServicePermission getEnabled()
    Factory method that specifies that a user service can be displayed or executed in the current session context.

  - ### getDisabled

    public static UserServicePermission getDisabled()
    Factory method that specifies that a user service can not be displayed or executed in the current session context. This method does not provide a reason for this restriction. To specify a reason, use the `getDisabled(UserMessage)` method.

  - ### getDisabled

    public static UserServicePermission getDisabled(UserMessage aReason)
    Factory method that specifies that a user service can not be displayed or executed 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)`

  - ### 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 UserServicePermission parseFlag(String actionFlag)
    Factory method. The argument specified can be obtained by calling the method `getFlagString()`.

  - ### parseFlag

    public static UserServicePermission 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.

  - ### toDisplayString

    public String toDisplayString(Locale aLocale)

  - ### min

    public UserServicePermission min(UserServicePermission anotherPermission)
    Returns the most restrictive permission between this instance and the instance given as an argument.

  - ### max

    public UserServicePermission max(UserServicePermission anotherPermission)
    Returns the least restrictive permission between this instance and the instance given as an argument.