Package ome.util
Class PermDetails
- java.lang.Object
-
- ome.util.PermDetails
-
- All Implemented Interfaces:
java.io.Serializable,IObject,Filterable
public class PermDetails extends java.lang.Object implements IObject
wrapper class which can be used in HQL queries to properly load the full context for a permissions object. Rather than writing a query of the form:select d.details.permissions from Dataset dwhich returns aPermissionsobject with none of the extended restrictions (canRead, canAnnotate, etc) properly loaded, use:select new ome.util.PermDetails(d) from Dataset dThe return value for each will be the same.- See Also:
- HHH-3868, trac-12474, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PermDetails(IObject context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptFilter(Filter filter)java.util.Set<?>fields()returns a Set of field names that belong to this classDetailsgetDetails()Value (i.e.GraphHoldergetGraphHolder()retrieves theGraphHolderfor this entity.java.lang.LonggetId()primary key of this object.IObjectgetInternalContext()In order to properly test the permissions for this object, it must be possible to get the internal context.booleanisLoaded()transient field (not stored in the DB) which specifies whether this object has been loaded from the DB or is only a wrapper around the ID.booleanisValid()calls the class-specific validator for this instance and returns the value fromValidation.isValid()voidputAt(java.lang.String field, java.lang.Object value)stores a value in this instance.java.lang.Objectretrieve(java.lang.String field)retrieves a value from this instance.voidsetId(java.lang.Long id)usually unneeded.voidunload()set the loaded field to false, and set all non-ID fields to null.Validationvalidate()calls the class-specific validator for this instance and returns theValidationobject.
-
-
-
Constructor Detail
-
PermDetails
public PermDetails(IObject context)
-
-
Method Detail
-
getInternalContext
public IObject getInternalContext()
In order to properly test the permissions for this object, it must be possible to get the internal context. This is for use by the security system only.
-
getId
public java.lang.Long getId()
Description copied from interface:IObjectprimary key of this object. Before the session is flushed, this value may be null.
-
setId
public void setId(java.lang.Long id)
Description copied from interface:IObjectusually unneeded. Ids are managed by the backend.
-
getDetails
public Details getDetails()
Description copied from interface:IObjectValue (i.e. not entity) which is available on all rows in the database. Low-level "details" such as security, ownership, auditing are managed here. When setting values onDetails, it is important to realize that most of the values are managed by the backend and may be replaced. For example, a user does not have permission to change the owner of an object, not even when owned by that user. To replace all of the values from an existingDetailsinstance, useDetails.copy(Details)orDetails.shallowCopy(Details)- Specified by:
getDetailsin interfaceIObject
-
isLoaded
public boolean isLoaded()
Description copied from interface:IObjecttransient field (not stored in the DB) which specifies whether this object has been loaded from the DB or is only a wrapper around the ID.
-
unload
public void unload() throws ApiUsageExceptionDescription copied from interface:IObjectset the loaded field to false, and set all non-ID fields to null. Subsequent calls to all accessors other than getId/setId will throw an ApiUsageException- Specified by:
unloadin interfaceIObject- Throws:
ApiUsageException
-
isValid
public boolean isValid()
Description copied from interface:IObjectcalls the class-specific validator for this instance and returns the value fromValidation.isValid()
-
validate
public Validation validate()
Description copied from interface:IObjectcalls the class-specific validator for this instance and returns theValidationobject.
-
retrieve
public java.lang.Object retrieve(java.lang.String field)
Description copied from interface:IObjectretrieves a value from this instance. Values forfieldwhich match a field of this instance will be delegated to the accessors. Otherwise, values will be retrieved from a lazy-loaded map filled by calls toIObject.putAt(String, Object)
-
putAt
public void putAt(java.lang.String field, java.lang.Object value)Description copied from interface:IObjectstores a value in this instance. Values forfieldwhich match a field of this instance will be delegated to the accessors. Otherwise, values will be stored in a lazy-loaded map.
-
fields
public java.util.Set<?> fields()
Description copied from interface:IObjectreturns a Set of field names that belong to this class
-
getGraphHolder
public GraphHolder getGraphHolder()
Description copied from interface:IObjectretrieves theGraphHolderfor this entity. If the GraphHolder has not been actively set, a new one will be instatiated.- Specified by:
getGraphHolderin interfaceIObject- Returns:
- Non-null GraphHolder
-
acceptFilter
public boolean acceptFilter(Filter filter)
- Specified by:
acceptFilterin interfaceFilterable
-
-