Package org.opencms.security
Class CmsPermissionSetCustom
java.lang.Object
org.opencms.security.CmsPermissionSet
org.opencms.security.CmsPermissionSetCustom
- All Implemented Interfaces:
Serializable
A custom permission set that can be modified during runtime and contains both allowed and denied permissions as bitsets.
- Since:
- 6.0.0
- See Also:
-
Field Summary
Fields inherited from class org.opencms.security.CmsPermissionSet
ACCESS_CONTROL, ACCESS_DIRECT_PUBLISH, ACCESS_READ, ACCESS_VIEW, ACCESS_WRITE, m_allowed, m_denied, PERMISSION_CONTROL, PERMISSION_DIRECT_PUBLISH, PERMISSION_EMPTY, PERMISSION_FULL, PERMISSION_READ, PERMISSION_VIEW, PERMISSION_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionConstructor to create an empty permission set.CmsPermissionSetCustom(int allowedPermissions) Constructor to create a permission set with preset allowed permissions.CmsPermissionSetCustom(int allowedPermissions, int deniedPermissions) Constructor to create a permission set with preset allowed and denied permissions.CmsPermissionSetCustom(String permissionString) Constructor to create a permission set with preset allowed and denied permissions from a String.CmsPermissionSetCustom(CmsPermissionSet permissions) Constructor to create a permission set with preset allowed and denied permissions from another permission set. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPermissions(CmsPermissionSet permissionSet) Sets permissions from another permission set additionally both as allowed and denied permissions.clone()Returns a clone of this Objects instance.voiddenyPermissions(int permissions) Sets permissions additionally as denied permissions.voidgrantPermissions(int permissions) Sets permissions additionally as allowed permissions.booleanReturns true if the permissions should be cacheable.voidsetCacheable(boolean cacheable) Sets the 'cacheable' field.voidsetPermissions(int allowedPermissions, int deniedPermissions) Sets permissions as allowed and denied permissions in the permission set.voidsetPermissions(CmsPermissionSet permissionSet) Set permissions from another permission set both as allowed and denied permissions.Methods inherited from class org.opencms.security.CmsPermissionSet
equals, getAllowedPermissions, getDeniedPermissions, getPermissionKeys, getPermissions, getPermissionString, getPermissionValue, hashCode, requiresControlPermission, requiresDirectPublishPermission, requiresReadPermission, requiresViewPermission, requiresWritePermission, toString
-
Constructor Details
-
CmsPermissionSetCustom
public CmsPermissionSetCustom()Constructor to create an empty permission set. -
CmsPermissionSetCustom
Constructor to create a permission set with preset allowed and denied permissions from another permission set.The permissions are read from a string representation of permissions in the format
{{+|-}{r|w|v|c|d}}*.- Parameters:
permissions- the set of allowed and denied permissions
-
CmsPermissionSetCustom
Constructor to create a permission set with preset allowed permissions.- Parameters:
allowedPermissions- bitset of allowed permissions
-
CmsPermissionSetCustom
Constructor to create a permission set with preset allowed and denied permissions.- Parameters:
allowedPermissions- the set of permissions to allowdeniedPermissions- the set of permissions to deny
-
CmsPermissionSetCustom
Constructor to create a permission set with preset allowed and denied permissions from a String.The permissions are read from a string representation of permissions in the format
{{+|-}{r|w|v|c|d}}*.- Parameters:
permissionString- the string representation of allowed and denied permissions
-
-
Method Details
-
addPermissions
Sets permissions from another permission set additionally both as allowed and denied permissions.- Parameters:
permissionSet- the set of permissions to set additionally.
-
clone
Returns a clone of this Objects instance. -
denyPermissions
Sets permissions additionally as denied permissions.- Parameters:
permissions- bitset of permissions to deny
-
grantPermissions
Sets permissions additionally as allowed permissions.- Parameters:
permissions- bitset of permissions to allow
-
isCacheable
Returns true if the permissions should be cacheable.- Returns:
- true if the permissions should be cacheable
-
setCacheable
Sets the 'cacheable' field.- Parameters:
cacheable- true if the permissions should be cacheable
-
setPermissions
Set permissions from another permission set both as allowed and denied permissions.Permissions formerly set are overwritten.
- Parameters:
permissionSet- the set of permissions
-
setPermissions
Sets permissions as allowed and denied permissions in the permission set.Permissions formerly set are overwritten.
- Parameters:
allowedPermissions- bitset of permissions to allowdeniedPermissions- bitset of permissions to deny
-