Class AccessPermission

java.lang.Object
com.orchestranetworks.service.AccessPermission

public final class AccessPermission extends Object
Defines the permission to see and modify a resource. The possible states are:
  • hidden – the resource is not displayed;
  • read-only – the resource is shown but it cannot be modified; optionally a message may tell why;
  • read-write – the resource is displayed and it may be modified;

  • Method Details

    • parseFlag

      public static AccessPermission parseFlag(String accessFlag)
      Factory method. The method getFlagString() returns the specified argument.
      See Also:
    • parseFlag

      public static AccessPermission parseFlag(char accessFlag)
      Factory method. The method getFlag() returns the specified argument.
      See Also:
    • getReadWrite

      public static AccessPermission getReadWrite()
      Factory method specifying that a resource can be displayed and modified.
    • getReadOnly

      public static AccessPermission getReadOnly()
      Factory method specifying that a resource can be displayed but not modified.
    • getReadOnly

      public static AccessPermission getReadOnly(UserMessage aReason)
      Factory method specifying that a resource can be displayed but it cannot modified. The reason why resource cannot modified may be provided to the user.

      Warning: the message is not always displayed in the current version of EBX®.

    • getHidden

      public static AccessPermission getHidden()
      Factory method specifying that a resource can neither be modified nor displayed.
    • getHidden

      public static AccessPermission getHidden(UserMessage aReason)
      Factory method specifying that a resource can not be modified and is not displayed.

      The reason specified will be exploited in a future release.

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isReadWrite

      public boolean isReadWrite()
    • isReadOnly

      public boolean isReadOnly()
    • isHidden

      public boolean isHidden()
    • getReadOnlyReason

      public UserMessage getReadOnlyReason()
      Optionally defined if this state is set as 'readOnly' or as 'hidden' and a specific reason is provided.
      See Also:
    • min

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

      public AccessPermission min(Supplier<AccessPermission> anotherPermissionSupplier)
      Returns the most restrictive between this permission, and the permission supplied by the specified function.

      Note that when this permission is hidden, the supplier function will not be called for performance.

      Since:
      6.0.0
    • max

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

      public AccessPermission max(Supplier<AccessPermission> anotherPermissionSupplier)
      Returns the least restrictive between this permission, and the permission supplied by the specified function.

      Note that when this permission is read-write, the supplier function will not be called for performance.

      Since:
      6.0.0
    • getFlag

      public char getFlag()
      Persistent flag that identifies this permission.
    • getFlagString

      public String getFlagString()
      Persistent flag that identifies this permission.

      It returns the same content as getFlag().

    • getLabel

      public String getLabel()
      Returns a developer-friendly string label.