Interface Permission
- All Superinterfaces:
Cloneable
Encapsulation of node permission flags which depend on the tree structure and on a
group or a user and his assigned
groups.
The user "admin" has always the permissions as specified in CAN_EVERYTHING, a project admin has at least
the permissions as specified in PROJECT_ADMIN_PERMISSIONS.- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAppend (new) folder nodes permission flag.static final intAppend (new) leaf nodes permission flag.static final intData change permission flag.static final intPermission to change permissions.static final intDelete folder node permission flag.static final intDelete folder permission flag.static final intCombination of all permission flags (sum or bitwise or).static final intMeta data change permission flag.static final intMeta data visibility (and read) permission flag.static final intData read permission flag.static final intReleas node permission flag.static final intTree visibility permission flag.static final int[]A summary of all permissions.static final intCombination of permission flags for project admins. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPermissionListener(PermissionListener permissionListener) Adds the givenpermission listenerto be notified on permission change events.allow(int p) Grants the given permission.booleanReturnstrueif the current user is allowed to append folders to the underlyingelement.booleanReturnstrueif the current user is allowed to append leaf elements to the underlyingelement.booleanReturnstrueif the current user is allowed to change the underlyingelement.booleanReturnstrueif the current user is allowed to change permissions of the underlyingelement.booleanReturnstrueif the current user is allowed to delete the underlyingelement.booleanReturnstrueif the current user is allowed to delete folders from the underlyingelement.booleanReturnstrueif the current user is allowed to delete leaf elements from the underlyingelement.booleanReturnstrueif the current user is allowed to change meta data of the underlyingelement.booleanReturnstrueif the current user is allowed to see meta data of the underlyingelement.booleancanRead()Returnstrueif the current user is allowed to read the underlyingelement.booleanReturnstrueif the current user is allowed to release the underlyingelement.booleancanSee()Returnstrueif the current user is allowed to see the underlyingelement.clone()forbid(int p) Revokes the given permission.Returns the underlying element.booleanisAllowed(int p) Check if a single permission is grantedvoidremovePermissionListener(PermissionListener permissionListener) Removes the givenpermission listener.
-
Field Details
-
CAN_SEE
static final int CAN_SEETree visibility permission flag.- Since:
- 3.0
- See Also:
-
CAN_READ
static final int CAN_READData read permission flag.- Since:
- 3.0
- See Also:
-
CAN_CHANGE
static final int CAN_CHANGEData change permission flag.- Since:
- 3.0
- See Also:
-
CAN_APPEND_FOLDER
static final int CAN_APPEND_FOLDERAppend (new) folder nodes permission flag. Only relevant for nodes which are of the type "folder".- Since:
- 3.0
- See Also:
-
CAN_APPEND_LEAF
static final int CAN_APPEND_LEAFAppend (new) leaf nodes permission flag. Only relevant for nodes which are of the type "folder".- Since:
- 3.0
- See Also:
-
CAN_DELETE_FOLDER
static final int CAN_DELETE_FOLDERDelete folder node permission flag. Only relevant for nodes which are of the type "folder".- Since:
- 3.0
- See Also:
-
CAN_DELETE_LEAF
static final int CAN_DELETE_LEAFDelete folder permission flag. Only relevant for nodes which are of the type "leaf" (leaves may have child nodes!).- Since:
- 3.0
- See Also:
-
CAN_CHANGE_PERMISSION
static final int CAN_CHANGE_PERMISSIONPermission to change permissions.- Since:
- 3.0
- See Also:
-
CAN_RELEASE
static final int CAN_RELEASEReleas node permission flag.- Since:
- 3.0
- See Also:
-
CAN_META_SEE
static final int CAN_META_SEEMeta data visibility (and read) permission flag.- Since:
- 3.0
- See Also:
-
CAN_META_CHANGE
static final int CAN_META_CHANGEMeta data change permission flag.- Since:
- 3.0
- See Also:
-
CAN_EVERYTHING
static final int CAN_EVERYTHINGCombination of all permission flags (sum or bitwise or).- Since:
- 3.0
- See Also:
-
PROJECT_ADMIN_PERMISSIONS
static final int PROJECT_ADMIN_PERMISSIONSCombination of permission flags for project admins.- Since:
- 3.0.81
- See Also:
-
PERMISSIONS
static final int[] PERMISSIONSA summary of all permissions.- Since:
- 3.0
-
-
Method Details
-
allow
Grants the given permission.- Returns:
- This permission object.
- Since:
- 3.0
-
forbid
Revokes the given permission.- Returns:
- This permission object.
- Since:
- 3.0
-
isAllowed
boolean isAllowed(int p) Check if a single permission is granted- Parameters:
p-- Returns:
trueif the current user is the super admin (login "admin") or this permission is granted.- Since:
- 3.0
-
canSee
boolean canSee()Returnstrueif the current user is allowed to see the underlyingelement.- Returns:
trueif the current user is allowed to see the underlyingelement.- Since:
- 3.0
-
canRead
boolean canRead()Returnstrueif the current user is allowed to read the underlyingelement.- Returns:
trueif the current user is allowed to read the underlyingelement.- Since:
- 3.0
-
canChange
boolean canChange()Returnstrueif the current user is allowed to change the underlyingelement.- Returns:
trueif the current user is allowed to change the underlyingelement.- Since:
- 3.0
-
canAppendLeaf
boolean canAppendLeaf()Returnstrueif the current user is allowed to append leaf elements to the underlyingelement.- Returns:
trueif the current user is allowed to append leaf elements to the underlyingelement.- Since:
- 3.0
-
canAppendFolder
boolean canAppendFolder()Returnstrueif the current user is allowed to append folders to the underlyingelement.- Returns:
trueif the current user is allowed to append folders to the underlyingelement.- Since:
- 3.0
-
canDelete
boolean canDelete()Returnstrueif the current user is allowed to delete the underlyingelement.- Returns:
trueif the current user is allowed to delete the underlyingelement.- Since:
- 3.0.64
-
canDeleteLeaf
boolean canDeleteLeaf()Returnstrueif the current user is allowed to delete leaf elements from the underlyingelement.- Returns:
trueif the current user is allowed to delete leaf elements from the underlyingelement.- Since:
- 3.0
-
canDeleteFolder
boolean canDeleteFolder()Returnstrueif the current user is allowed to delete folders from the underlyingelement.- Returns:
trueif the current user is allowed to delete folders from the underlyingelement.- Since:
- 3.0
-
canChangePermission
boolean canChangePermission()Returnstrueif the current user is allowed to change permissions of the underlyingelement.- Returns:
trueif the current user is allowed to change permissions of the underlyingelement.- Since:
- 3.0
-
canRelease
boolean canRelease()Returnstrueif the current user is allowed to release the underlyingelement.- Returns:
trueif the current user is allowed to release the underlyingelement.- Since:
- 3.0
-
canMetaSee
boolean canMetaSee()Returnstrueif the current user is allowed to see meta data of the underlyingelement.- Returns:
trueif the current user is allowed to see meta data of the underlyingelement.- Since:
- 3.1.158
-
canMetaChange
boolean canMetaChange()Returnstrueif the current user is allowed to change meta data of the underlyingelement.- Returns:
trueif the current user is allowed to change meta data of the underlyingelement.- Since:
- 3.1.158
-
getStoreElement
StoreElement getStoreElement()Returns the underlying element.- Returns:
- The underlying element.
- Since:
- 3.0
-
clone
Object clone()- Since:
- 3.0.7
-
addPermissionListener
Adds the givenpermission listenerto be notified on permission change events.- Parameters:
permissionListener- The listener to be notified.- Since:
- 3.0.7
-
removePermissionListener
Removes the givenpermission listener.- Parameters:
permissionListener- The listener to be removed.- Since:
- 3.0.7
-