public class BasicACLVoter extends Object implements ACLVoter
Token, 
SecuritySystem, 
Details, 
Permissions| Modifier and Type | Field and Description | 
|---|---|
| protected CurrentDetails | currentUser | 
| protected PolicyService | policyService | 
| protected Roles | roles | 
| protected SecurityFilter | securityFilter | 
| protected SystemTypes | sysTypes | 
| protected TokenHolder | tokenHolder | 
| Constructor and Description | 
|---|
| BasicACLVoter(CurrentDetails cd,
             SystemTypes sysTypes,
             TokenHolder tokenHolder,
             SecurityFilter securityFilter,
             PolicyService policyService) | 
| BasicACLVoter(CurrentDetails cd,
             SystemTypes sysTypes,
             TokenHolder tokenHolder,
             SecurityFilter securityFilter,
             PolicyService policyService,
             Roles roles) | 
| 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
  Permissionschanged within the currentsecurity 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,
         Class<? extends IObject> klass,
         Details d,
         long id)delegates to SecurityFilter because that is where the logic is defined
 for the  read filterIgnores the id for the moment. | 
| boolean | allowUpdate(IObject iObject,
           Details trustedDetails)test whether the given object should be updateable given the trusted
  details. | 
| void | postProcess(IObject object) | 
| Set<String> | restrictions(IObject object)Provide the active restrictions for this  IObject. | 
| void | throwCreationViolation(IObject iObject)throws a  SecurityViolationbased on the givenIObjectand
 the context of the current user. | 
| void | throwDeleteViolation(IObject iObject)throws a  SecurityViolationbased on the givenIObjectand
 the context of the current user. | 
| void | throwLoadViolation(IObject iObject)throws a  SecurityViolationbased on the givenIObjectand
 the context of the current user. | 
| void | throwUpdateViolation(IObject iObject)throws a  SecurityViolationbased on the givenIObjectand
 the context of the current user. | 
protected final CurrentDetails currentUser
protected final SystemTypes sysTypes
protected final TokenHolder tokenHolder
protected final SecurityFilter securityFilter
protected final PolicyService policyService
protected final Roles roles
public BasicACLVoter(CurrentDetails cd, SystemTypes sysTypes, TokenHolder tokenHolder, SecurityFilter securityFilter, PolicyService policyService)
public BasicACLVoter(CurrentDetails cd, SystemTypes sysTypes, TokenHolder tokenHolder, SecurityFilter securityFilter, PolicyService policyService, Roles roles)
public boolean allowChmod(IObject iObject)
ACLVoterPermissions changed within the current
 security context.allowChmod in interface ACLVoteriObject - a model objectpublic boolean allowLoad(org.hibernate.Session session,
                         Class<? extends IObject> klass,
                         Details d,
                         long id)
read filter
 
 Ignores the id for the moment.
 
 Though we pass in whether or not a share is active for completeness, a
 different ACLVoter implementation will almost certainly be active
 for share use.allowLoad in interface ACLVotersession - 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(IObject iObject) throws SecurityViolation
ACLVoterSecurityViolation based on the given IObject and
 the context of the current user.throwLoadViolation in interface ACLVoteriObject - Non-null object which caused this violationSecurityViolationACLEventListener.onPostLoad(org.hibernate.event.PostLoadEvent)public boolean allowCreation(IObject iObject)
ACLVoterdetails 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 ACLVoteriObject - a non-null entity to test for creation.ACLEventListener.onPreInsert(org.hibernate.event.PreInsertEvent)public void throwCreationViolation(IObject iObject) throws SecurityViolation
ACLVoterSecurityViolation based on the given IObject and
 the context of the current user.throwCreationViolation in interface ACLVoteriObject - Non-null object which caused this violationSecurityViolationACLEventListener.onPreInsert(org.hibernate.event.PreInsertEvent)public boolean allowAnnotate(IObject iObject, Details trustedDetails)
ACLVoterdetails. The details will usually be retrieved from the
 current state array coming from the database.allowAnnotate in interface ACLVoteriObject - a non-null entity to test for update.trustedDetails - a Details instance that is known to be valid.public boolean allowUpdate(IObject iObject, Details trustedDetails)
ACLVoterdetails. 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 ACLVoteriObject - 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(IObject iObject) throws SecurityViolation
ACLVoterSecurityViolation based on the given IObject and
 the context of the current user.throwUpdateViolation in interface ACLVoteriObject - Non-null object which caused this violationSecurityViolationACLEventListener.onPreUpdate(org.hibernate.event.PreUpdateEvent)public boolean allowDelete(IObject iObject, Details trustedDetails)
ACLVoterdetails. 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 ACLVoteriObject - 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(IObject iObject) throws SecurityViolation
ACLVoterSecurityViolation based on the given IObject and
 the context of the current user.throwDeleteViolation in interface ACLVoteriObject - Non-null object which caused this violationSecurityViolationACLEventListener.onPreDelete(org.hibernate.event.PreDeleteEvent)public Set<String> restrictions(IObject object)
ACLVoterIObject.
 See PolicyService for further details.restrictions in interface ACLVoterobject - a model object
                
                
Version: 5.2.1-ice35-b15
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.