Package net.sf.basedb.core
Class ChildItem
- java.lang.Object
-
- net.sf.basedb.core.BasicItem
-
- net.sf.basedb.core.ChildItem
-
- All Implemented Interfaces:
AccessControlled
,Identifiable
- Direct Known Subclasses:
ArrayDesignBlock
,ArrayDesignPlate
,BioAssay
,BioAssaySet
,BioMaterialEvent
,BioPlateEventParticipant
,BioWell
,DataCube
,DataCubeColumn
,DataCubeExtraValue
,DataCubeFilter
,DataCubeLayer
,ExtraValue
,Help
,JobAgentSettings
,PlateEvent
,PlateEventType
,RootRawBioAssay
,SyncFilter
,Transformation
,VirtualDb
,Well
abstract class ChildItem extends BasicItem
An abstract base class for all items which are child items to aShareable
parent item. This class implements theinitPermissions(int, int)
method and sets the permissions for the child item based on the permissions for the parent item.If the logged in user has read permission for the parent, READ permission is granted. If the logged in user has write permission for the parent, WRITE, DELETE and CREATE permission is granted.
This class should only be used if the parent item itself hasn't overridden the
initPermissions
method, since that method is never called. This class can be used even if the immediate parent isn't a shareable item, as long as it is possible for a child item to follow a chain of association to the actual parent where the permissions are set. For exampleBioAssay
-->BioAssaySet
-->Experiment
.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
Shareable
- Last modified
- $Date: 2015-04-17 14:02:22 +0200 (fr, 17 apr 2015) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) Permission
getPermissionForUse()
Get the permission that is required on the parent item that gives use permission on the child item.(package private) Permission
getPermissionForWriteDeleteAndCreate()
Get the permission that is required on the parent item that gives write, delete and create permission on the child item.(package private) PluginPermission
getPluginPermissions()
(package private) abstract SharedData
getSharedParent()
Get the shareable parent item of this child item.(package private) void
initPermissions(int granted, int denied)
If the logged in user has read permission for the parent, read permission is granted.-
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.basedb.core.Identifiable
getType
-
-
-
-
Constructor Detail
-
ChildItem
ChildItem(BasicData data)
-
-
Method Detail
-
initPermissions
void initPermissions(int granted, int denied) throws BaseException
If the logged in user has read permission for the parent, read permission is granted. If the logged in user has the permission returned by thegetPermissionForWriteDeleteAndCreate()
method for the parent, WRITE, DELETE and CREATE permission is granted.- Overrides:
initPermissions
in classBasicItem
- Parameters:
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass- Throws:
BaseException
- If the permissions couldn't be initialised
-
getPluginPermissions
PluginPermission getPluginPermissions()
- Overrides:
getPluginPermissions
in classBasicItem
-
getPermissionForWriteDeleteAndCreate
Permission getPermissionForWriteDeleteAndCreate()
Get the permission that is required on the parent item that gives write, delete and create permission on the child item. The defult permission is write.
-
getPermissionForUse
Permission getPermissionForUse()
Get the permission that is required on the parent item that gives use permission on the child item. The defult permission is use.- Since:
- 3.3.1
-
getSharedParent
abstract SharedData getSharedParent()
Get the shareable parent item of this child item. This is used by theinitPermissions(int, int)
method to calculate the logged in user's permissions for the child item.- Returns:
- The parent item
-
-