Last update: 2011-06-23

org.proteios.core
Interface AccessControlled

All Known Subinterfaces:
DiskConsumable, FileAttachable, Identifiable, Nameable, Ownable, Removable, Shareable, SystemItem
All Known Implementing Classes:
Acquisition, AnnotatedItem, Annotation, AnnotationSet, AnnotationType, BasicBatcher, BasicItem, BioMaterial, BioMaterialEvent, BioSource, Client, CommonItem, CreationEvent, DataProcessingStep, DigestParameter, Directory, DiskUsage, Extract, Feature, File, FileType, GelElectrophoresis, GelImageAnalysisEvent, GelScanEvent, GlobalDefaultSetting, Group, Hardware, HardwareConfiguration, HardwareType, Hit, InstrumentConfiguration, IPG, ItemKey, Job, Key, Label, LabeledExtract, LiquidChromatography, MascotParameterSetStorage, MeasuredArea, MeasuredBioMaterial, Message, MimeType, Modification, News, ObservedModification, OMSSAParameterSetStorage, OwnedItem, Peak, PeakBatcher, PeakList, PeakListBatcher, PeakListSet, Peptide, PluginConfiguration, PluginDefinition, PluginType, PolyPeptide, Precursor, Project, ProjectKey, Protein, Protocol, ProtocolType, Quota, QuotaType, Role, RoleKey, Sample, SearchDatabase, SearchModification, SearchResult, SeparationEvent, SeparationMethod, Session, Setting, SharedItem, Software, SoftwareConfiguration, SoftwareType, SpectrumSearch, StainingEvent, UpdateEvent, User, XTandemParameterSetStorage

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 Proteios 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
 void checkPermission(Permission permission)
          Check if the logged in user has the desired permission on the item, otherwise throw an exception.
 boolean hasPermission(Permission permission)
          Check if the logged in user has the desired permission on the item.
 

Method Detail

hasPermission

boolean hasPermission(Permission permission)
Check if the logged in user has the desired permission on the item.

Returns:
TRUE if the user has the permission, FALSE otherwise

checkPermission

void checkPermission(Permission permission)
                     throws PermissionDeniedException
Check if the logged in user has the desired permission on the item, otherwise throw an exception.

Throws:
PermissionDeniedException - If the user doesn't have the requested permission

Last update: 2011-06-23