Package net.sf.basedb.core
Interface Ownable
-
- All Superinterfaces:
AccessControlled
,Identifiable
- All Known Subinterfaces:
DiskConsumable
,Shareable
- All Known Implementing Classes:
AnnotatedItem
,AnnotationType
,AnnotationTypeCategory
,ArrayBatch
,ArrayDesign
,ArraySlide
,BioMaterial
,BioPlate
,BioPlateEvent
,BioSource
,Client
,CommonItem
,DerivedBioAssay
,Directory
,Experiment
,Extract
,File
,FileServer
,Formula
,Hardware
,ItemList
,Job
,JobAgent
,Kit
,MeasuredBioMaterial
,OwnedItem
,PermissionTemplate
,PhysicalBioAssay
,Plate
,PlateMapping
,PlateType
,PluginConfiguration
,PluginDefinition
,Project
,Protocol
,RawBioAssay
,ReporterCloneTemplate
,ReporterList
,Sample
,SharedItem
,Software
,Tag
public interface Ownable extends Identifiable
AnOwnable
item is an item which has aUser
as its owner. TheOwnableUtil
class provides methods that includes data validation to make it easy to implement this interface.Reference implementation
public User getOwner() throws PermissionDeniedException, BaseException { return getDbControl().getItem(User.class, getData().getOwner()); } public void setOwner(User owner) throws PermissionDeniedException, InvalidDataException { checkPermission(Permission.SET_OWNER); OwnableUtil.setOwner(getData(), owner); }
- Version:
- 2.0
- Author:
- Nicklas
- See Also:
OwnedItem
,OwnableUtil
- Last modified
- $Date: 2009-04-06 14:52:39 +0200 (må, 06 apr 2009) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description User
getOwner()
Get theUser
that is the owner of the item.boolean
isOwner()
Check if the logged in user is the owner of this item or not.void
setOwner(User owner)
Change the owner of the item.void
takeOwnership()
Take ownership of the item.-
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
-
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getType, getVersion
-
-
-
-
Method Detail
-
getOwner
User getOwner() throws PermissionDeniedException, BaseException
Get theUser
that is the owner of the item.- Returns:
- The owner of the item
- Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the ownerBaseException
- If there is another error
-
setOwner
void setOwner(User owner) throws PermissionDeniedException, InvalidDataException
Change the owner of the item.- Parameters:
owner
- The new owner of the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have permission to change the owner on the itemInvalidDataException
- If the owner is null- See Also:
takeOwnership()
-
takeOwnership
void takeOwnership() throws PermissionDeniedException
Take ownership of the item.- Throws:
PermissionDeniedException
- If the logged in user doesn't have permission to take ownership- Since:
- 2.2
-
isOwner
boolean isOwner()
Check if the logged in user is the owner of this item or not.- Returns:
- TRUE if the logged in user is the owner, FALSE otherwise
- Since:
- 2.2
-
-