Class 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 Detail

      • 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.

      • isReadWrite

        public boolean isReadWrite()
      • isReadOnly

        public boolean isReadOnly()
      • isHidden

        public boolean isHidden()
      • 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.