mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Use the bean id in the cache key to prevent actions and identifiers clashing
This commit is contained in:
@@ -46,17 +46,21 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
|||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.cmr.security.AccessStatus;
|
import org.alfresco.service.cmr.security.AccessStatus;
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
|
import org.springframework.beans.factory.BeanNameAware;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base evaluator.
|
* Base evaluator.
|
||||||
*
|
*
|
||||||
* @author Roy Wetherall
|
* @author Roy Wetherall
|
||||||
*/
|
*/
|
||||||
public abstract class BaseEvaluator implements RecordsManagementModel
|
public abstract class BaseEvaluator implements RecordsManagementModel, BeanNameAware
|
||||||
{
|
{
|
||||||
/** Name */
|
/** Name */
|
||||||
protected String name;
|
protected String name;
|
||||||
|
|
||||||
|
/** bean name */
|
||||||
|
protected String beanName;
|
||||||
|
|
||||||
/** JSON conversion component */
|
/** JSON conversion component */
|
||||||
protected JSONConversionComponent jsonConversionComponent;
|
protected JSONConversionComponent jsonConversionComponent;
|
||||||
|
|
||||||
@@ -90,6 +94,15 @@ public abstract class BaseEvaluator implements RecordsManagementModel
|
|||||||
/** transactional resource helper */
|
/** transactional resource helper */
|
||||||
protected TransactionalResourceHelper transactionalResourceHelper;
|
protected TransactionalResourceHelper transactionalResourceHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param beanName bean name
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setBeanName(String beanName)
|
||||||
|
{
|
||||||
|
this.beanName = beanName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param jsonConversionComponent json conversion component
|
* @param jsonConversionComponent json conversion component
|
||||||
*/
|
*/
|
||||||
@@ -231,7 +244,7 @@ public abstract class BaseEvaluator implements RecordsManagementModel
|
|||||||
public boolean evaluate(NodeRef nodeRef)
|
public boolean evaluate(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
Map<String, Boolean> results = transactionalResourceHelper.getMap("BaseEvaluator.evaluate");
|
Map<String, Boolean> results = transactionalResourceHelper.getMap("BaseEvaluator.evaluate");
|
||||||
String key = new StringBuffer(nodeRef.toString()).append(AuthenticationUtil.getRunAsUser()).append(name).toString();
|
String key = new StringBuffer(nodeRef.toString()).append(AuthenticationUtil.getRunAsUser()).append(beanName).toString();
|
||||||
|
|
||||||
if (!results.containsKey(key))
|
if (!results.containsKey(key))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user