Package net.sf.basedb.core
Interface AccessControlled
- All Known Subinterfaces:
Annotatable
,AnnotatableProxy
,DiskConsumable
,FileAttachable
,FileStoreEnabled
,Identifiable
,Listable
,Nameable
,Ownable
,Registered
,Removable
,Shareable
,Subtypable
,SystemItem
- All Known Implementing Classes:
AnnotatedItem
,Annotation
,AnnotationSet
,AnnotationType
,AnnotationTypeCategory
,AnyToAny
,ArrayBatch
,ArrayDesign
,ArrayDesignBlock
,ArrayDesignPlate
,ArraySlide
,BasicBatcher
,BasicChildItem
,BasicItem
,BioAssay
,BioAssaySet
,BioMaterial
,BioMaterialEvent
,BioMaterialEventSource
,BioPlate
,BioPlateEvent
,BioPlateEventParticipant
,BioPlateEventType
,BioPlateType
,BioSource
,BioWell
,ChangeHistory
,ChildItem
,Client
,ClientDefaultSetting
,Coloring
,CommonItem
,DataCube
,DataCubeColumn
,DataCubeExtraValue
,DataCubeFilter
,DataCubeLayer
,DataFileType
,DerivedBioAssay
,Directory
,DiskUsage
,Experiment
,ExtensionsControl
,Extract
,ExtraValue
,ExtraValueType
,FeatureBatcher
,File
,FileServer
,FileSet
,FileSetMember
,Formula
,GlobalDefaultSetting
,Group
,Hardware
,Help
,ItemKey
,ItemList
,ItemSubtype
,ItemSubtypeFileType
,Job
,JobAgent
,JobAgentSettings
,Key
,Kit
,MeasuredBioMaterial
,Message
,MimeType
,News
,OwnedItem
,PermissionTemplate
,PhysicalBioAssay
,Plate
,PlateEvent
,PlateEventType
,PlateGeometry
,PlateMapping
,PlateType
,Platform
,PlatformFileType
,PlatformVariant
,PluginConfiguration
,PluginDefinition
,PluginType
,Project
,ProjectKey
,Protocol
,Quantity
,Quota
,QuotaType
,RawBioAssay
,RawDataBatcher
,ReporterBatcher
,ReporterCloneTemplate
,ReporterList
,ReporterType
,Role
,RoleKey
,RootRawBioAssay
,Sample
,Session
,Setting
,SharedItem
,Software
,SyncFilter
,Tag
,Transformation
,Unit
,User
,UserClientSetting
,UserDefaultSetting
,UserDevice
,VirtualDb
,Well
public interface AccessControlled
This interface should be implemented by a class representing items
which requires the logged in user to have permission to access them.
Since all items in BASE should use access control, this interface should
be implemented by all items.
The BasicItem
which is the root superclass of all
items provides an implementation that checks the role keys for
access permission. Subclasses may override that implementation to
also check for other things. For example, the OwnedItem
class checks the item's owner against the logged in user.
- Version:
- 2.0
- Author:
- Nicklas
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkPermission
(Permission permission) Check if the logged in user has the desired permission on the item, otherwise throw an exception.Get the logged in user's permissions on the item.boolean
hasPermission
(Permission permission) Check if the logged in user has the desired permission on the item.
-
Method Details
-
hasPermission
Check if the logged in user has the desired permission on the item.- Parameters:
permission
- The permission to check if the user has.- Returns:
- TRUE if the user has the permission, FALSE otherwise
-
checkPermission
Check if the logged in user has the desired permission on the item, otherwise throw an exception.- Parameters:
permission
- Permission the user should have.- Throws:
PermissionDeniedException
- If the user doesn't have the requested permission
-
getPermissions
Set<Permission> getPermissions()Get the logged in user's permissions on the item.
-