Constructor and Description |
---|
SharingACLVoter(CurrentDetails cd,
SystemTypes sysTypes,
ShareStore store,
TokenHolder tokenHolder) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowAnnotate(ome.model.IObject iObject,
ome.model.internal.Details trustedDetails)
test whether the given object should be annotatable given the trusted
details . |
boolean |
allowChmod(ome.model.IObject iObject)
test whether the given object can have its
Permissions changed within the current
security context . |
boolean |
allowCreation(ome.model.IObject iObject)
test whether the given object should be insertable into the DB.
|
boolean |
allowDelete(ome.model.IObject iObject,
ome.model.internal.Details trustedDetails)
test whether the given object should be deleteable given the trusted
details . |
boolean |
allowLoad(org.hibernate.Session session,
java.lang.Class<? extends ome.model.IObject> klass,
ome.model.internal.Details d,
long id)
test whether the object of the given
Class with the given
Details should be loadable in the current security context. |
boolean |
allowUpdate(ome.model.IObject iObject,
ome.model.internal.Details trustedDetails)
test whether the given object should be updateable given the trusted
details . |
void |
postProcess(ome.model.IObject object)
Gives the
ACLVoter instance a chance to act on the IObject
after the transaction but before finishing the AOP stack. |
java.util.Set<java.lang.String> |
restrictions(ome.model.IObject object)
Provide the active restrictions for this
IObject . |
void |
setPermittedClasses(java.util.Map<java.lang.Integer,java.util.Set<java.lang.Class<? extends ome.model.IObject>>> objectClassesPermitted)
Specify object classes based on restriction constants in
Permissions that do not always have those
restrictions. |
void |
throwCreationViolation(ome.model.IObject iObject)
throws a
SecurityViolation based on the given IObject and
the context of the current user. |
void |
throwDeleteViolation(ome.model.IObject iObject)
throws a
SecurityViolation based on the given IObject and
the context of the current user. |
protected void |
throwDisabled(java.lang.String action) |
void |
throwLoadViolation(ome.model.IObject iObject)
throws a
SecurityViolation based on the given IObject and
the context of the current user. |
void |
throwUpdateViolation(ome.model.IObject iObject)
throws a
SecurityViolation based on the given IObject and
the context of the current user. |
public SharingACLVoter(CurrentDetails cd, SystemTypes sysTypes, ShareStore store, TokenHolder tokenHolder)
public boolean allowChmod(ome.model.IObject iObject)
ACLVoter
Permissions
changed within the current
security context
.allowChmod
in interface ACLVoter
iObject
- a model objectpublic boolean allowLoad(org.hibernate.Session session, java.lang.Class<? extends ome.model.IObject> klass, ome.model.internal.Details d, long id)
ACLVoter
Class
with the given
Details
should be loadable in the current security context.
This method does not take an actual object because that will not be
generated until after loading is permitted.
The SecuritySystem
implementors will usually call
ACLVoter.throwLoadViolation(IObject)
if this method returns false.allowLoad
in interface ACLVoter
session
- the Hibernate session to use for the queryklass
- a non-null class to test for loadingd
- the non-null trusted details (usually from the db) for this
instanceid
- the id of the object which will be loaded. As opposed to the
rest of the object, this must be known.ACLEventListener.onPostLoad(org.hibernate.event.PostLoadEvent)
public void throwLoadViolation(ome.model.IObject iObject) throws ome.conditions.SecurityViolation
ACLVoter
SecurityViolation
based on the given IObject
and
the context of the current user.throwLoadViolation
in interface ACLVoter
iObject
- Non-null object which caused this violationome.conditions.SecurityViolation
ACLEventListener.onPostLoad(org.hibernate.event.PostLoadEvent)
public boolean allowCreation(ome.model.IObject iObject)
ACLVoter
details
is passed to this method, since for
transient entities there are no trusted values.
The SecuritySystem
implementors will usually call
ACLVoter.throwCreationViolation(IObject)
if this method returns false.allowCreation
in interface ACLVoter
iObject
- a non-null entity to test for creation.ACLEventListener.onPreInsert(org.hibernate.event.PreInsertEvent)
public void throwCreationViolation(ome.model.IObject iObject) throws ome.conditions.SecurityViolation
ACLVoter
SecurityViolation
based on the given IObject
and
the context of the current user.throwCreationViolation
in interface ACLVoter
iObject
- Non-null object which caused this violationome.conditions.SecurityViolation
ACLEventListener.onPreInsert(org.hibernate.event.PreInsertEvent)
public boolean allowAnnotate(ome.model.IObject iObject, ome.model.internal.Details trustedDetails)
ACLVoter
details
. The details will usually be retrieved from the
current state array coming from the database.allowAnnotate
in interface ACLVoter
iObject
- a non-null entity to test for update.trustedDetails
- a Details
instance that is known to be valid.public boolean allowUpdate(ome.model.IObject iObject, ome.model.internal.Details trustedDetails)
ACLVoter
details
. The details will usually be retrieved from the
current state array coming from the database.
The SecuritySystem
implementors will usually call
ACLVoter.throwUpdateViolation(IObject)
if this method returns false.allowUpdate
in interface ACLVoter
iObject
- a non-null entity to test for update.trustedDetails
- a Details
instance that is known to be valid.ACLEventListener.onPreUpdate(org.hibernate.event.PreUpdateEvent)
public void throwUpdateViolation(ome.model.IObject iObject) throws ome.conditions.SecurityViolation
ACLVoter
SecurityViolation
based on the given IObject
and
the context of the current user.throwUpdateViolation
in interface ACLVoter
iObject
- Non-null object which caused this violationome.conditions.SecurityViolation
ACLEventListener.onPreUpdate(org.hibernate.event.PreUpdateEvent)
public boolean allowDelete(ome.model.IObject iObject, ome.model.internal.Details trustedDetails)
ACLVoter
details
. The details will usually be retrieved from the
current state array coming from the database.
The SecuritySystem
implementors will usually call
ACLVoter.throwDeleteViolation(IObject)
if this method returns false.allowDelete
in interface ACLVoter
iObject
- a non-null entity to test for deletion.trustedDetails
- a Details
instance that is known to be valid.ACLEventListener.onPreDelete(org.hibernate.event.PreDeleteEvent)
public void throwDeleteViolation(ome.model.IObject iObject) throws ome.conditions.SecurityViolation
ACLVoter
SecurityViolation
based on the given IObject
and
the context of the current user.throwDeleteViolation
in interface ACLVoter
iObject
- Non-null object which caused this violationome.conditions.SecurityViolation
ACLEventListener.onPreDelete(org.hibernate.event.PreDeleteEvent)
public java.util.Set<java.lang.String> restrictions(ome.model.IObject object)
ACLVoter
IObject
.
See PolicyService
for further details.restrictions
in interface ACLVoter
object
- a model objectpublic void setPermittedClasses(java.util.Map<java.lang.Integer,java.util.Set<java.lang.Class<? extends ome.model.IObject>>> objectClassesPermitted)
ACLVoter
Permissions
that do not always have those
restrictions.
Previously set classes may not be cleared by subsequent calls to this method.setPermittedClasses
in interface ACLVoter
objectClassesPermitted
- the map from restriction constants to object classes that may not have those restrictionspublic void postProcess(ome.model.IObject object)
ACLVoter
ACLVoter
instance a chance to act on the IObject
after the transaction but before finishing the AOP stack.postProcess
in interface ACLVoter
object
- a model objectprotected void throwDisabled(java.lang.String action)