public class CmsPermissionSet extends java.lang.Object
Currently supported permissions are:
PERMISSION_READ
(r) the right to read the contents of a resourcePERMISSION_WRITE
(w) the right to write the contents of a resourcePERMISSION_VIEW
(v) the right to see a resource in listings (workplace)PERMISSION_CONTROL
(c) the right to set permissions of a resourcePERMISSION_DIRECT_PUBLISH
(d) the right direct publish a resource even without publish project permissionsModifier and Type | Field and Description |
---|---|
static CmsPermissionSet |
ACCESS_CONTROL
Permission set to check control access.
|
static CmsPermissionSet |
ACCESS_DIRECT_PUBLISH
Permission set to check direct publish permissions.
|
static CmsPermissionSet |
ACCESS_READ
Permission set to check read access.
|
static CmsPermissionSet |
ACCESS_VIEW
Permission set to check view access.
|
static CmsPermissionSet |
ACCESS_WRITE
Permission set to check write access.
|
protected int |
m_allowed
The set of allowed permissions.
|
protected int |
m_denied
The set of denied permissions.
|
static int |
PERMISSION_CONTROL
The permission to control a resource.
|
static int |
PERMISSION_DIRECT_PUBLISH
The permission to direct publish a resource.
|
static int |
PERMISSION_EMPTY
No permissions for a resource (used especially for denied permissions).
|
static int |
PERMISSION_FULL
All allowed permissions for a resource.
|
static int |
PERMISSION_READ
The permission to read a resource.
|
static int |
PERMISSION_VIEW
The permission to view a resource.
|
static int |
PERMISSION_WRITE
The permission to write a resource.
|
Modifier | Constructor and Description |
---|---|
protected |
CmsPermissionSet()
Constructor to create an empty permission set.
|
protected |
CmsPermissionSet(int allowedPermissions)
Constructor to create a permission set with preset allowed permissions.
|
|
CmsPermissionSet(int allowedPermissions,
int deniedPermissions)
Constructor to create a permission set with preset allowed and denied permissions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
getAllowedPermissions()
Returns the currently allowed permissions of ths permission set.
|
int |
getDeniedPermissions()
Returns the currently denied permissions of this permission set.
|
static java.util.Set<java.lang.String> |
getPermissionKeys()
Returns the message keys of each permission known in the system.
|
int |
getPermissions()
Returns the permissions calculated from this permission set.
|
java.lang.String |
getPermissionString()
Returns the string representation of the current permissions in this permission set.
|
static int |
getPermissionValue(java.lang.String key)
Returns the value of a single permission.
|
int |
hashCode() |
boolean |
requiresControlPermission()
Returns true if control permissions (+c) are required by this permission set.
|
boolean |
requiresDirectPublishPermission()
Returns true if direct publish permissions (+d) are required by this permission set.
|
boolean |
requiresReadPermission()
Returns true if read permissions (+r) are required by this permission set.
|
boolean |
requiresViewPermission()
Returns true if view permissions (+v) are required by this permission set.
|
boolean |
requiresWritePermission()
Returns true if write permissions (+w) are required by this permission set.
|
java.lang.String |
toString()
Returns the String representation of this permission set object.
|
public static final CmsPermissionSet ACCESS_CONTROL
public static final CmsPermissionSet ACCESS_DIRECT_PUBLISH
public static final CmsPermissionSet ACCESS_READ
public static final CmsPermissionSet ACCESS_VIEW
public static final CmsPermissionSet ACCESS_WRITE
protected int m_allowed
protected int m_denied
public static final int PERMISSION_CONTROL
public static final int PERMISSION_DIRECT_PUBLISH
public static final int PERMISSION_EMPTY
public static final int PERMISSION_FULL
public static final int PERMISSION_READ
public static final int PERMISSION_VIEW
public static final int PERMISSION_WRITE
protected CmsPermissionSet()
protected CmsPermissionSet(int allowedPermissions)
allowedPermissions
- bitset of allowed permissionspublic CmsPermissionSet(int allowedPermissions, int deniedPermissions)
allowedPermissions
- the set of permissions to allowdeniedPermissions
- the set of permissions to denypublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int getAllowedPermissions()
public int getDeniedPermissions()
public static java.util.Set<java.lang.String> getPermissionKeys()
public int getPermissions()
These are all permissions allowed but not denied.
public java.lang.String getPermissionString()
public static int getPermissionValue(java.lang.String key)
key
- the key of the permissionpublic int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean requiresControlPermission()
public boolean requiresDirectPublishPermission()
public boolean requiresReadPermission()
public boolean requiresViewPermission()
public boolean requiresWritePermission()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()