Package com.orchestranetworks.service
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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description chargetFlag()Persistent flag that identifies this permission.StringgetFlagString()Persistent flag that identifies this permission.static AccessPermissiongetHidden()Factory method specifying that a resource can neither be modified nor displayed.static AccessPermissiongetHidden (UserMessage aReason)Factory method specifying that a resource can not be modified and is not displayed.StringgetLabel()Returns a developer-friendly string label.static AccessPermissiongetReadOnly()Factory method specifying that a resource can be displayed but not modified.static AccessPermissiongetReadOnly (UserMessage aReason)Factory method specifying that a resource can be displayed but it cannot modified.UserMessagegetReadOnlyReason()Optionally defined if this state is set as 'readOnly' or as 'hidden' and a specific reason is provided.static AccessPermissiongetReadWrite()Factory method specifying that a resource can be displayed and modified.booleanisHidden()booleanisReadOnly()booleanisReadWrite()AccessPermissionmax (AccessPermission anotherPermission)Returns the least restrictive between this permission and the permission given as an argument.AccessPermissionmax (Supplier<AccessPermission> anotherPermissionSupplier)Returns the least restrictive between this permission, and the permission supplied by the specified function.AccessPermissionmin (AccessPermission anotherPermission)Returns the most restrictive between this permission and the permission given as an argument.AccessPermissionmin (Supplier<AccessPermission> anotherPermissionSupplier)Returns the most restrictive between this permission, and the permission supplied by the specified function.static AccessPermissionparseFlag (char accessFlag)Factory method.static AccessPermissionparseFlag (String accessFlag)Factory method.StringtoString()
-
-
Method Detail
parseFlag
public static AccessPermission parseFlag(String accessFlag)
Factory method. The methodgetFlagString()returns the specified argument.- See Also:
parseFlag(char)
parseFlag
public static AccessPermission parseFlag(char accessFlag)
Factory method. The methodgetFlag()returns the specified argument.- See Also:
parseFlag(String)
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()
getReadOnlyReason
public UserMessage getReadOnlyReason()
Optionally defined if this state is set as 'readOnly' or as 'hidden' and a specific reason is provided.- See Also:
getHidden(UserMessage),getReadOnly(UserMessage)
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.
-