public interface ACLVoter
SecuritySystem
,
ACLEventListener
Modifier and Type | Method and Description |
---|---|
boolean |
allowAnnotate(IObject iObject,
Details trustedDetails)
test whether the given object should be annotatable given the trusted
details . |
boolean |
allowChmod(IObject iObject)
test whether the given object can have its
Permissions changed within the current
security context . |
boolean |
allowCreation(IObject iObject)
test whether the given object should be insertable into the DB.
|
boolean |
allowDelete(IObject iObject,
Details trustedDetails)
test whether the given object should be deleteable given the trusted
details . |
boolean |
allowLoad(org.hibernate.Session session,
java.lang.Class<? extends IObject> klass,
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(IObject iObject,
Details trustedDetails)
test whether the given object should be updateable given the trusted
details . |
void |
postProcess(IObject obj)
|
java.util.Set<java.lang.String> |
restrictions(IObject object)
Provide the active restrictions for this
IObject . |
void |
setPermittedClasses(java.util.Map<java.lang.Integer,java.util.Set<java.lang.Class<? extends IObject>>> objectClassesPermitted)
Specify object classes based on restriction constants in
Permissions that do not always have those
restrictions. |
void |
throwCreationViolation(IObject iObject)
throws a
SecurityViolation based on the given IObject and
the context of the current user. |
void |
throwDeleteViolation(IObject iObject)
throws a
SecurityViolation based on the given IObject and
the context of the current user. |
void |
throwLoadViolation(IObject iObject)
throws a
SecurityViolation based on the given IObject and
the context of the current user. |
void |
throwUpdateViolation(IObject iObject)
throws a
SecurityViolation based on the given IObject and
the context of the current user. |
boolean allowChmod(IObject iObject)
Permissions
changed within the current
security context
.iObject
- a model objectboolean allowLoad(org.hibernate.Session session, java.lang.Class<? extends IObject> klass, Details trustedDetails, long id)
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.session
- the Hibernate session to use for the queryklass
- a non-null class to test for loadingtrustedDetails
- 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)
boolean allowCreation(IObject iObject)
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.iObject
- a non-null entity to test for creation.ACLEventListener.onPreInsert(org.hibernate.event.PreInsertEvent)
boolean allowAnnotate(IObject iObject, Details trustedDetails)
details
. The details will usually be retrieved from the
current state array coming from the database.iObject
- a non-null entity to test for update.trustedDetails
- a Details
instance that is known to be valid.boolean allowUpdate(IObject iObject, Details trustedDetails)
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.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)
boolean allowDelete(IObject iObject, Details trustedDetails)
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.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)
void throwLoadViolation(IObject iObject) throws SecurityViolation
SecurityViolation
based on the given IObject
and
the context of the current user.iObject
- Non-null object which caused this violationSecurityViolation
ACLEventListener.onPostLoad(org.hibernate.event.PostLoadEvent)
void throwCreationViolation(IObject iObject) throws SecurityViolation
SecurityViolation
based on the given IObject
and
the context of the current user.iObject
- Non-null object which caused this violationSecurityViolation
ACLEventListener.onPreInsert(org.hibernate.event.PreInsertEvent)
void throwUpdateViolation(IObject iObject) throws SecurityViolation
SecurityViolation
based on the given IObject
and
the context of the current user.iObject
- Non-null object which caused this violationSecurityViolation
ACLEventListener.onPreUpdate(org.hibernate.event.PreUpdateEvent)
void throwDeleteViolation(IObject iObject) throws SecurityViolation
SecurityViolation
based on the given IObject
and
the context of the current user.iObject
- Non-null object which caused this violationSecurityViolation
ACLEventListener.onPreDelete(org.hibernate.event.PreDeleteEvent)
java.util.Set<java.lang.String> restrictions(IObject object)
IObject
.
See PolicyService
for further details.object
- a model objectvoid setPermittedClasses(java.util.Map<java.lang.Integer,java.util.Set<java.lang.Class<? extends IObject>>> objectClassesPermitted)
Permissions
that do not always have those
restrictions.
Previously set classes may not be cleared by subsequent calls to this method.objectClassesPermitted
- the map from restriction constants to object classes that may not have those restrictions
Version: 5.4.6-ice35-b87
Copyright © 2018 The University of Dundee & Open Microscopy Environment. All Rights Reserved.