ome.security
Interface ACLVoter

All Known Implementing Classes:
BasicACLVoter, CompositeACLVoter, SharingACLVoter

public interface ACLVoter

helper security interface for all decisions on access control

Since:
3.0-M3
Version:
$Revision$, $Date$
Author:
Josh Moore, josh.moore at gmx.de
See Also:
SecuritySystem, ACLEventListener

Method Summary
 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(Class<? extends ome.model.IObject> klass, ome.model.internal.Details trustedDetails, 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 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.
 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.
 

Method Detail

allowChmod

boolean allowChmod(ome.model.IObject iObject)
test whether the given object can have its Permissions changed within the current security context.


allowLoad

boolean allowLoad(Class<? extends ome.model.IObject> klass,
                  ome.model.internal.Details trustedDetails,
                  long id)
test whether the object of the given 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 throwLoadViolation(IObject) if this method returns false.

Parameters:
klass - a non-null class to test for loading
d - the non-null trusted details (usually from the db) for this instance
id - the id of the object which will be loaded. As opposed to the rest of the object, this must be known.
Returns:
true if loading of this object can proceed
See Also:
ACLEventListener.onPostLoad(org.hibernate.event.PostLoadEvent)

allowCreation

boolean allowCreation(ome.model.IObject iObject)
test whether the given object should be insertable into the DB. No trusted details is passed to this method, since for transient entities there are no trusted values. The SecuritySystem implementors will usually call throwCreationViolation(IObject) if this method returns false.

Parameters:
iObject - a non-null entity to test for creation.
Returns:
true if creation of this object can proceed
See Also:
ACLEventListener.onPreInsert(org.hibernate.event.PreInsertEvent)

allowUpdate

boolean allowUpdate(ome.model.IObject iObject,
                    ome.model.internal.Details trustedDetails)
test whether the given object should be updateable given the trusted details. The details will usually be retrieved from the current state array coming from the database. The SecuritySystem implementors will usually call throwUpdateViolation(IObject) if this method returns false.

Parameters:
iObject - a non-null entity to test for update.
trustedDetails - a Details instance that is known to be valid.
Returns:
true if update of this object can proceed
See Also:
ACLEventListener.onPreUpdate(org.hibernate.event.PreUpdateEvent)

allowDelete

boolean allowDelete(ome.model.IObject iObject,
                    ome.model.internal.Details trustedDetails)
test whether the given object should be deleteable given the trusted details. The details will usually be retrieved from the current state array coming from the database. The SecuritySystem implementors will usually call throwDeleteViolation(IObject) if this method returns false.

Parameters:
iObject - a non-null entity to test for deletion.
trustedDetails - a Details instance that is known to be valid.
Returns:
true if deletion of this object can proceed
See Also:
ACLEventListener.onPreDelete(org.hibernate.event.PreDeleteEvent)

throwLoadViolation

void throwLoadViolation(ome.model.IObject iObject)
                        throws ome.conditions.SecurityViolation
throws a SecurityViolation based on the given IObject and the context of the current user.

Parameters:
iObject - Non-null object which caused this violation
Throws:
ome.conditions.SecurityViolation
See Also:
ACLEventListener#onPostLoad(org.hibernate.event.PostLoadEvent)}

throwCreationViolation

void throwCreationViolation(ome.model.IObject iObject)
                            throws ome.conditions.SecurityViolation
throws a SecurityViolation based on the given IObject and the context of the current user.

Parameters:
iObject - Non-null object which caused this violation
Throws:
ome.conditions.SecurityViolation
See Also:
ACLEventListener#onPreInsert(org.hibernate.event.PreInsertEvent)}

throwUpdateViolation

void throwUpdateViolation(ome.model.IObject iObject)
                          throws ome.conditions.SecurityViolation
throws a SecurityViolation based on the given IObject and the context of the current user.

Parameters:
iObject - Non-null object which caused this violation
Throws:
ome.conditions.SecurityViolation
See Also:
ACLEventListener.onPreUpdate(org.hibernate.event.PreUpdateEvent)

throwDeleteViolation

void throwDeleteViolation(ome.model.IObject iObject)
                          throws ome.conditions.SecurityViolation
throws a SecurityViolation based on the given IObject and the context of the current user.

Parameters:
iObject - Non-null object which caused this violation
Throws:
ome.conditions.SecurityViolation
See Also:
ACLEventListener.onPreDelete(org.hibernate.event.PreDeleteEvent)


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

Copyright © 2009 The University of Dundee. All Rights Reserved.