mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-1162: CLONE - Alfresco 4.2.1 could not start with RM module
* see MNT-10259 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.1@60429 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
parent="rmBaseCapability"
|
parent="rmBaseCapability"
|
||||||
class="org.alfresco.module.org_alfresco_module_rm.capability.impl.CreateCapability">
|
class="org.alfresco.module.org_alfresco_module_rm.capability.impl.CreateCapability">
|
||||||
<property name="recordService" ref="recordService"/>
|
<property name="recordService" ref="recordService"/>
|
||||||
|
<property name="recordsManagementService" ref="recordsManagementService"/>
|
||||||
<property name="name" value="Create"/>
|
<property name="name" value="Create"/>
|
||||||
<property name="private" value="true"/>
|
<property name="private" value="true"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
@@ -46,9 +46,7 @@
|
|||||||
<bean id="RMSecurityCommon" abstract="true">
|
<bean id="RMSecurityCommon" abstract="true">
|
||||||
<property name="nodeService" ref="nodeService"/>
|
<property name="nodeService" ref="nodeService"/>
|
||||||
<property name="permissionService" ref="permissionService"/>
|
<property name="permissionService" ref="permissionService"/>
|
||||||
<property name="recordsManagementService" ref="recordsManagementService"/>
|
|
||||||
<property name="caveatConfigComponent" ref="caveatConfigComponent"/>
|
<property name="caveatConfigComponent" ref="caveatConfigComponent"/>
|
||||||
<property name="filePlanService" ref="filePlanService"/>
|
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- ====== -->
|
<!-- ====== -->
|
||||||
|
@@ -962,7 +962,8 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
|||||||
String uuid = DefaultTypeConverter.INSTANCE.convert(String.class, filtered.get(ContentModel.PROP_NODE_UUID));
|
String uuid = DefaultTypeConverter.INSTANCE.convert(String.class, filtered.get(ContentModel.PROP_NODE_UUID));
|
||||||
StoreRef storeRef = new StoreRef(protocol, identifier);
|
StoreRef storeRef = new StoreRef(protocol, identifier);
|
||||||
NodeRef nodeRef = new NodeRef(storeRef, uuid);
|
NodeRef nodeRef = new NodeRef(storeRef, uuid);
|
||||||
if ((nodeRef == null) || (permissionService.hasPermission(filePlanService.getFilePlan(nodeRef), RMPermissionModel.VIEW_UPDATE_REASONS_FOR_FREEZE) != AccessStatus.ALLOWED))
|
if ((nodeRef == null) ||
|
||||||
|
(permissionService.hasPermission(getFilePlanService().getFilePlan(nodeRef), RMPermissionModel.VIEW_UPDATE_REASONS_FOR_FREEZE) != AccessStatus.ALLOWED))
|
||||||
{
|
{
|
||||||
filtered.remove(RecordsManagementModel.PROP_HOLD_REASON);
|
filtered.remove(RecordsManagementModel.PROP_HOLD_REASON);
|
||||||
}
|
}
|
||||||
|
@@ -40,10 +40,7 @@ import org.alfresco.service.namespace.NamespacePrefixResolver;
|
|||||||
import org.aopalliance.intercept.MethodInvocation;
|
import org.aopalliance.intercept.MethodInvocation;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.beans.BeansException;
|
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.context.ApplicationContextAware;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Records managment entry voter.
|
* Records managment entry voter.
|
||||||
@@ -51,7 +48,7 @@ import org.springframework.context.ApplicationContextAware;
|
|||||||
* @author Roy Wetherall, Andy Hind
|
* @author Roy Wetherall, Andy Hind
|
||||||
*/
|
*/
|
||||||
public class RMEntryVoter extends RMSecurityCommon
|
public class RMEntryVoter extends RMSecurityCommon
|
||||||
implements AccessDecisionVoter, InitializingBean, ApplicationContextAware, PolicyRegister
|
implements AccessDecisionVoter, InitializingBean, PolicyRegister
|
||||||
{
|
{
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static Log logger = LogFactory.getLog(RMEntryVoter.class);
|
private static Log logger = LogFactory.getLog(RMEntryVoter.class);
|
||||||
@@ -71,18 +68,6 @@ public class RMEntryVoter extends RMSecurityCommon
|
|||||||
/** Policy map */
|
/** Policy map */
|
||||||
private HashMap<String, Policy> policies = new HashMap<String, Policy>();
|
private HashMap<String, Policy> policies = new HashMap<String, Policy>();
|
||||||
|
|
||||||
/** Application context */
|
|
||||||
private ApplicationContext applicationContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
|
||||||
{
|
|
||||||
this.applicationContext = applicationContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param capabilityService capability service
|
* @param capabilityService capability service
|
||||||
*/
|
*/
|
||||||
|
@@ -20,8 +20,6 @@ package org.alfresco.module.org_alfresco_module_rm.capability;
|
|||||||
|
|
||||||
import net.sf.acegisecurity.vote.AccessDecisionVoter;
|
import net.sf.acegisecurity.vote.AccessDecisionVoter;
|
||||||
|
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.caveat.RMCaveatConfigComponent;
|
import org.alfresco.module.org_alfresco_module_rm.caveat.RMCaveatConfigComponent;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||||
@@ -37,6 +35,9 @@ import org.alfresco.service.cmr.security.PermissionService;
|
|||||||
import org.aopalliance.intercept.MethodInvocation;
|
import org.aopalliance.intercept.MethodInvocation;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.springframework.beans.BeansException;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.ApplicationContextAware;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,7 +48,7 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
* @author Roy Wetherall
|
* @author Roy Wetherall
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
public class RMSecurityCommon
|
public class RMSecurityCommon implements ApplicationContextAware
|
||||||
{
|
{
|
||||||
/** No set value */
|
/** No set value */
|
||||||
protected int NOSET_VALUE = -100;
|
protected int NOSET_VALUE = -100;
|
||||||
@@ -58,9 +59,20 @@ public class RMSecurityCommon
|
|||||||
/** Services */
|
/** Services */
|
||||||
protected NodeService nodeService; //This is the internal NodeService -- no permission checks
|
protected NodeService nodeService; //This is the internal NodeService -- no permission checks
|
||||||
protected PermissionService permissionService;
|
protected PermissionService permissionService;
|
||||||
protected RecordsManagementService rmService;
|
|
||||||
protected RMCaveatConfigComponent caveatConfigComponent;
|
protected RMCaveatConfigComponent caveatConfigComponent;
|
||||||
protected FilePlanService filePlanService;
|
private FilePlanService filePlanService;
|
||||||
|
|
||||||
|
/** Application context */
|
||||||
|
protected ApplicationContext applicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||||
|
{
|
||||||
|
this.applicationContext = applicationContext;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param nodeService node service
|
* @param nodeService node service
|
||||||
@@ -78,14 +90,6 @@ public class RMSecurityCommon
|
|||||||
this.permissionService = permissionService;
|
this.permissionService = permissionService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param rmService records management service
|
|
||||||
*/
|
|
||||||
public void setRecordsManagementService(RecordsManagementService rmService)
|
|
||||||
{
|
|
||||||
this.rmService = rmService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param caveatConfigComponent caveat config service
|
* @param caveatConfigComponent caveat config service
|
||||||
*/
|
*/
|
||||||
@@ -95,11 +99,15 @@ public class RMSecurityCommon
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param filePlanService file plan service
|
* @return FilePlanService file plan service
|
||||||
*/
|
*/
|
||||||
public void setFilePlanService(FilePlanService filePlanService)
|
protected FilePlanService getFilePlanService()
|
||||||
{
|
{
|
||||||
this.filePlanService = filePlanService;
|
if (filePlanService == null)
|
||||||
|
{
|
||||||
|
filePlanService = (FilePlanService)applicationContext.getBean("filePlanService");
|
||||||
|
}
|
||||||
|
return filePlanService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -205,17 +213,7 @@ public class RMSecurityCommon
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the file plan for the node
|
// Get the file plan for the node
|
||||||
NodeRef filePlan = filePlanService.getFilePlan(nodeRef);
|
NodeRef filePlan = getFilePlanService().getFilePlan(nodeRef);
|
||||||
|
|
||||||
// Admin role
|
|
||||||
//if (permissionService.hasPermission(filePlan, RMPermissionModel.ROLE_ADMINISTRATOR) == AccessStatus.ALLOWED)
|
|
||||||
//{
|
|
||||||
// if (logger.isDebugEnabled())
|
|
||||||
// {
|
|
||||||
// logger.debug("\t\tAdmin user, access granted. (nodeRef=" + nodeRef.toString() + ", user=" + AuthenticationUtil.getRunAsUser() + ")");
|
|
||||||
// }
|
|
||||||
// return setTransactionCache("checkRmRead", nodeRef, AccessDecisionVoter.ACCESS_GRANTED);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (permissionService.hasPermission(nodeRef, RMPermissionModel.READ_RECORDS) == AccessStatus.DENIED)
|
if (permissionService.hasPermission(nodeRef, RMPermissionModel.READ_RECORDS) == AccessStatus.DENIED)
|
||||||
{
|
{
|
||||||
@@ -252,16 +250,11 @@ public class RMSecurityCommon
|
|||||||
NodeRef testNodeRef = null;
|
NodeRef testNodeRef = null;
|
||||||
if (position < 0)
|
if (position < 0)
|
||||||
{
|
{
|
||||||
testNodeRef = filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
|
|
||||||
if (testNodeRef == null)
|
|
||||||
{
|
|
||||||
throw new AlfrescoRuntimeException("Unable to find default file plan node.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
||||||
logger.debug("\tPermission test against the file plan node " + nodeService.getPath(testNodeRef));
|
logger.debug("\tNothing to test permission against.");
|
||||||
}
|
}
|
||||||
|
testNodeRef = null;
|
||||||
}
|
}
|
||||||
else if (StoreRef.class.isAssignableFrom(params[position]))
|
else if (StoreRef.class.isAssignableFrom(params[position]))
|
||||||
{
|
{
|
||||||
|
@@ -92,8 +92,8 @@ public class CompositeCapability extends DeclarativeCapability
|
|||||||
int result = AccessDecisionVoter.ACCESS_ABSTAIN;
|
int result = AccessDecisionVoter.ACCESS_ABSTAIN;
|
||||||
|
|
||||||
// Check we are dealing with a file plan component
|
// Check we are dealing with a file plan component
|
||||||
if (filePlanService.isFilePlanComponent(source) == true &&
|
if (getFilePlanService().isFilePlanComponent(source) == true &&
|
||||||
filePlanService.isFilePlanComponent(target) == true)
|
getFilePlanService().isFilePlanComponent(target) == true)
|
||||||
{
|
{
|
||||||
// Check the kind of the object, the permissions and the conditions
|
// Check the kind of the object, the permissions and the conditions
|
||||||
if (checkKinds(source) == true && checkPermissions(source) == true && checkConditions(source) == true)
|
if (checkKinds(source) == true && checkPermissions(source) == true && checkConditions(source) == true)
|
||||||
|
@@ -33,9 +33,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
|||||||
import org.alfresco.service.cmr.security.AccessStatus;
|
import org.alfresco.service.cmr.security.AccessStatus;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.beans.BeansException;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.context.ApplicationContextAware;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Declarative capability implementation.
|
* Declarative capability implementation.
|
||||||
@@ -43,14 +40,10 @@ import org.springframework.context.ApplicationContextAware;
|
|||||||
* @author Roy Wetherall
|
* @author Roy Wetherall
|
||||||
*/
|
*/
|
||||||
public class DeclarativeCapability extends AbstractCapability
|
public class DeclarativeCapability extends AbstractCapability
|
||||||
implements ApplicationContextAware
|
|
||||||
{
|
{
|
||||||
/** Logger */
|
/** Logger */
|
||||||
protected static Log logger = LogFactory.getLog(DeclarativeCapability.class);
|
protected static Log logger = LogFactory.getLog(DeclarativeCapability.class);
|
||||||
|
|
||||||
/** Application Context */
|
|
||||||
protected ApplicationContext applicationContext;
|
|
||||||
|
|
||||||
/** Required permissions */
|
/** Required permissions */
|
||||||
protected List<String> permissions;
|
protected List<String> permissions;
|
||||||
|
|
||||||
@@ -66,12 +59,6 @@ public class DeclarativeCapability extends AbstractCapability
|
|||||||
/** Indicates whether to return an undetermined result */
|
/** Indicates whether to return an undetermined result */
|
||||||
protected boolean isUndetermined = false;
|
protected boolean isUndetermined = false;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
|
||||||
{
|
|
||||||
this.applicationContext = applicationContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param permissions permissions
|
* @param permissions permissions
|
||||||
*/
|
*/
|
||||||
@@ -170,7 +157,7 @@ public class DeclarativeCapability extends AbstractCapability
|
|||||||
protected boolean checkPermissionsImpl(NodeRef nodeRef, String ... permissions)
|
protected boolean checkPermissionsImpl(NodeRef nodeRef, String ... permissions)
|
||||||
{
|
{
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
NodeRef filePlan = filePlanService.getFilePlan(nodeRef);
|
NodeRef filePlan = getFilePlanService().getFilePlan(nodeRef);
|
||||||
|
|
||||||
for (String permission : permissions)
|
for (String permission : permissions)
|
||||||
{
|
{
|
||||||
@@ -261,7 +248,7 @@ public class DeclarativeCapability extends AbstractCapability
|
|||||||
{
|
{
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
|
||||||
FilePlanComponentKind actualKind = filePlanService.getFilePlanComponentKind(nodeRef);
|
FilePlanComponentKind actualKind = getFilePlanService().getFilePlanComponentKind(nodeRef);
|
||||||
|
|
||||||
if (actualKind != null)
|
if (actualKind != null)
|
||||||
{
|
{
|
||||||
@@ -298,7 +285,7 @@ public class DeclarativeCapability extends AbstractCapability
|
|||||||
int result = AccessDecisionVoter.ACCESS_ABSTAIN;
|
int result = AccessDecisionVoter.ACCESS_ABSTAIN;
|
||||||
|
|
||||||
// Check we are dealing with a file plan component
|
// Check we are dealing with a file plan component
|
||||||
if (filePlanService.isFilePlanComponent(nodeRef) == true)
|
if (getFilePlanService().isFilePlanComponent(nodeRef) == true)
|
||||||
{
|
{
|
||||||
// Check the kind of the object, the permissions and the conditions
|
// Check the kind of the object, the permissions and the conditions
|
||||||
if (checkKinds(nodeRef) == true && checkPermissions(nodeRef) == true && checkConditions(nodeRef) == true)
|
if (checkKinds(nodeRef) == true && checkPermissions(nodeRef) == true && checkConditions(nodeRef) == true)
|
||||||
|
@@ -45,11 +45,11 @@ public class ChangeOrDeleteReferencesCapability extends DeclarativeCapability
|
|||||||
*/
|
*/
|
||||||
public int evaluate(NodeRef source, NodeRef target)
|
public int evaluate(NodeRef source, NodeRef target)
|
||||||
{
|
{
|
||||||
if (filePlanService.isFilePlanComponent(source))
|
if (getFilePlanService().isFilePlanComponent(source))
|
||||||
{
|
{
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
if (filePlanService.isFilePlanComponent(target) == true)
|
if (getFilePlanService().isFilePlanComponent(target) == true)
|
||||||
{
|
{
|
||||||
if (checkConditions(source) == true && checkConditions(target) == true)
|
if (checkConditions(source) == true && checkConditions(target) == true)
|
||||||
{
|
{
|
||||||
|
@@ -24,6 +24,7 @@ import java.util.Map;
|
|||||||
import net.sf.acegisecurity.vote.AccessDecisionVoter;
|
import net.sf.acegisecurity.vote.AccessDecisionVoter;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
|
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.capability.declarative.DeclarativeCapability;
|
import org.alfresco.module.org_alfresco_module_rm.capability.declarative.DeclarativeCapability;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||||
@@ -40,11 +41,21 @@ public class CreateCapability extends DeclarativeCapability
|
|||||||
{
|
{
|
||||||
private RecordService recordService;
|
private RecordService recordService;
|
||||||
|
|
||||||
|
protected RecordsManagementService rmService;
|
||||||
|
|
||||||
public void setRecordService(RecordService recordService)
|
public void setRecordService(RecordService recordService)
|
||||||
{
|
{
|
||||||
this.recordService = recordService;
|
this.recordService = recordService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param rmService records management service
|
||||||
|
*/
|
||||||
|
public void setRecordsManagementService(RecordsManagementService rmService)
|
||||||
|
{
|
||||||
|
this.rmService = rmService;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#evaluate(org.alfresco.service.cmr.repository.NodeRef)
|
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#evaluate(org.alfresco.service.cmr.repository.NodeRef)
|
||||||
*/
|
*/
|
||||||
@@ -72,7 +83,7 @@ public class CreateCapability extends DeclarativeCapability
|
|||||||
return AccessDecisionVoter.ACCESS_DENIED;
|
return AccessDecisionVoter.ACCESS_DENIED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (filePlanService.isFilePlanComponent(destination))
|
if (getFilePlanService().isFilePlanComponent(destination))
|
||||||
{
|
{
|
||||||
if ((assocType == null) || assocType.equals(ContentModel.ASSOC_CONTAINS) == false)
|
if ((assocType == null) || assocType.equals(ContentModel.ASSOC_CONTAINS) == false)
|
||||||
{
|
{
|
||||||
@@ -122,7 +133,7 @@ public class CreateCapability extends DeclarativeCapability
|
|||||||
{
|
{
|
||||||
if (rmService.isRecordFolder(destination))
|
if (rmService.isRecordFolder(destination))
|
||||||
{
|
{
|
||||||
if (permissionService.hasPermission(filePlanService.getFilePlan(destination), RMPermissionModel.DECLARE_RECORDS_IN_CLOSED_FOLDERS) == AccessStatus.ALLOWED)
|
if (permissionService.hasPermission(getFilePlanService().getFilePlan(destination), RMPermissionModel.DECLARE_RECORDS_IN_CLOSED_FOLDERS) == AccessStatus.ALLOWED)
|
||||||
{
|
{
|
||||||
return AccessDecisionVoter.ACCESS_GRANTED;
|
return AccessDecisionVoter.ACCESS_GRANTED;
|
||||||
}
|
}
|
||||||
@@ -135,7 +146,7 @@ public class CreateCapability extends DeclarativeCapability
|
|||||||
{
|
{
|
||||||
if (rmService.isRecordFolder(destination))
|
if (rmService.isRecordFolder(destination))
|
||||||
{
|
{
|
||||||
if (permissionService.hasPermission(filePlanService.getFilePlan(destination), RMPermissionModel.CREATE_MODIFY_RECORDS_IN_CUTOFF_FOLDERS) == AccessStatus.ALLOWED)
|
if (permissionService.hasPermission(getFilePlanService().getFilePlan(destination), RMPermissionModel.CREATE_MODIFY_RECORDS_IN_CUTOFF_FOLDERS) == AccessStatus.ALLOWED)
|
||||||
{
|
{
|
||||||
return AccessDecisionVoter.ACCESS_GRANTED;
|
return AccessDecisionVoter.ACCESS_GRANTED;
|
||||||
}
|
}
|
||||||
|
@@ -45,8 +45,8 @@ public class DeleteLinksCapability extends DeclarativeCapability
|
|||||||
*/
|
*/
|
||||||
public int evaluate(NodeRef source, NodeRef target)
|
public int evaluate(NodeRef source, NodeRef target)
|
||||||
{
|
{
|
||||||
if (filePlanService.isFilePlanComponent(source) == true &&
|
if (getFilePlanService().isFilePlanComponent(source) == true &&
|
||||||
filePlanService.isFilePlanComponent(target) == true)
|
getFilePlanService().isFilePlanComponent(target) == true)
|
||||||
{
|
{
|
||||||
if (checkConditions(source) == true && checkConditions(target) == true)
|
if (checkConditions(source) == true && checkConditions(target) == true)
|
||||||
{
|
{
|
||||||
|
@@ -35,7 +35,7 @@ public final class ViewRecordsCapability extends DeclarativeCapability
|
|||||||
{
|
{
|
||||||
if (nodeRef != null)
|
if (nodeRef != null)
|
||||||
{
|
{
|
||||||
if (filePlanService.isFilePlanComponent(nodeRef) == true)
|
if (getFilePlanService().isFilePlanComponent(nodeRef) == true)
|
||||||
{
|
{
|
||||||
return checkRmRead(nodeRef);
|
return checkRmRead(nodeRef);
|
||||||
}
|
}
|
||||||
|
@@ -39,8 +39,8 @@ public class CapabilityPolicy extends AbstractBasePolicy
|
|||||||
Class[] params,
|
Class[] params,
|
||||||
ConfigAttributeDefinition cad)
|
ConfigAttributeDefinition cad)
|
||||||
{
|
{
|
||||||
NodeRef assignee = getTestNode(invocation, params, cad.getParameters().get(0), cad.isParent());
|
NodeRef testNodeRef = getTestNode(invocation, params, cad.getParameters().get(0), cad.isParent());
|
||||||
return capabilityService.getCapability(RMPermissionModel.MANAGE_ACCESS_CONTROLS).evaluate(assignee);
|
return capabilityService.getCapability(RMPermissionModel.MANAGE_ACCESS_CONTROLS).evaluate(testNodeRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -97,9 +97,6 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
|||||||
protected QName ASPECT_CUSTOM_ASPECT = QName.createQName(URI, "customAspect");
|
protected QName ASPECT_CUSTOM_ASPECT = QName.createQName(URI, "customAspect");
|
||||||
protected QName ASPECT_RECORD_META_DATA = QName.createQName(URI, "recordMetaData");
|
protected QName ASPECT_RECORD_META_DATA = QName.createQName(URI, "recordMetaData");
|
||||||
|
|
||||||
/** site id's */
|
|
||||||
protected static final String COLLABORATION_SITE_ID = "collab-site-id";
|
|
||||||
|
|
||||||
/** Common test utils */
|
/** Common test utils */
|
||||||
protected CommonRMTestUtils utils;
|
protected CommonRMTestUtils utils;
|
||||||
|
|
||||||
@@ -151,6 +148,7 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
|||||||
protected DispositionSchedule dispositionSchedule;
|
protected DispositionSchedule dispositionSchedule;
|
||||||
protected NodeRef rmFolder;
|
protected NodeRef rmFolder;
|
||||||
protected NodeRef unfiledContainer;
|
protected NodeRef unfiledContainer;
|
||||||
|
protected String collabSiteId;
|
||||||
|
|
||||||
/** multi-hierarchy test data
|
/** multi-hierarchy test data
|
||||||
*
|
*
|
||||||
@@ -428,9 +426,9 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
// delete the collaboration site (if required)
|
// delete the collaboration site (if required)
|
||||||
if (isCollaborationSiteTest() == true && siteService.getSite(COLLABORATION_SITE_ID) != null)
|
if (isCollaborationSiteTest() == true && siteService.getSite(collabSiteId) != null)
|
||||||
{
|
{
|
||||||
siteService.deleteSite(COLLABORATION_SITE_ID);
|
siteService.deleteSite(collabSiteId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
@@ -709,9 +707,10 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
|||||||
protected void setupCollaborationSiteTestDataImpl()
|
protected void setupCollaborationSiteTestDataImpl()
|
||||||
{
|
{
|
||||||
// create collaboration site
|
// create collaboration site
|
||||||
collaborationSite = siteService.createSite("preset", COLLABORATION_SITE_ID, "title", "description", SiteVisibility.PRIVATE);
|
collabSiteId = GUID.generate();
|
||||||
|
collaborationSite = siteService.createSite("preset", collabSiteId, "title", "description", SiteVisibility.PRIVATE);
|
||||||
documentLibrary = SiteServiceImpl.getSiteContainer(
|
documentLibrary = SiteServiceImpl.getSiteContainer(
|
||||||
COLLABORATION_SITE_ID,
|
collabSiteId,
|
||||||
SiteService.DOCUMENT_LIBRARY,
|
SiteService.DOCUMENT_LIBRARY,
|
||||||
true,
|
true,
|
||||||
siteService,
|
siteService,
|
||||||
@@ -726,11 +725,11 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
|||||||
|
|
||||||
dmConsumer = GUID.generate();
|
dmConsumer = GUID.generate();
|
||||||
dmConsumerNodeRef = createPerson(dmConsumer);
|
dmConsumerNodeRef = createPerson(dmConsumer);
|
||||||
siteService.setMembership(COLLABORATION_SITE_ID, dmConsumer, SiteModel.SITE_CONSUMER);
|
siteService.setMembership(collabSiteId, dmConsumer, SiteModel.SITE_CONSUMER);
|
||||||
|
|
||||||
dmCollaborator = GUID.generate();
|
dmCollaborator = GUID.generate();
|
||||||
dmCollaboratorNodeRef = createPerson(dmCollaborator);
|
dmCollaboratorNodeRef = createPerson(dmCollaborator);
|
||||||
siteService.setMembership(COLLABORATION_SITE_ID, dmCollaborator, SiteModel.SITE_COLLABORATOR);
|
siteService.setMembership(collabSiteId, dmCollaborator, SiteModel.SITE_COLLABORATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -71,9 +71,6 @@ import org.springframework.context.ApplicationContext;
|
|||||||
*/
|
*/
|
||||||
public class BaseRMWebScriptTestCase extends BaseWebScriptTest
|
public class BaseRMWebScriptTestCase extends BaseWebScriptTest
|
||||||
{
|
{
|
||||||
/** Collab site id */
|
|
||||||
protected static final String COLLAB_SITE_ID = "myCollabSite";
|
|
||||||
|
|
||||||
/** Common test utils */
|
/** Common test utils */
|
||||||
protected CommonRMTestUtils utils;
|
protected CommonRMTestUtils utils;
|
||||||
|
|
||||||
@@ -121,6 +118,7 @@ public class BaseRMWebScriptTestCase extends BaseWebScriptTest
|
|||||||
protected DispositionSchedule dispositionSchedule;
|
protected DispositionSchedule dispositionSchedule;
|
||||||
protected NodeRef recordFolder;
|
protected NodeRef recordFolder;
|
||||||
protected NodeRef recordFolder2;
|
protected NodeRef recordFolder2;
|
||||||
|
protected String collabSiteId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the test collaboration site should be created
|
* Indicates whether the test collaboration site should be created
|
||||||
@@ -219,7 +217,7 @@ public class BaseRMWebScriptTestCase extends BaseWebScriptTest
|
|||||||
// Delete the collaboration site (if required)
|
// Delete the collaboration site (if required)
|
||||||
if (isCollaborationSiteTest() == true)
|
if (isCollaborationSiteTest() == true)
|
||||||
{
|
{
|
||||||
siteService.deleteSite(COLLAB_SITE_ID);
|
siteService.deleteSite(collabSiteId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,9 +323,10 @@ public class BaseRMWebScriptTestCase extends BaseWebScriptTest
|
|||||||
protected void setupCollaborationSiteTestDataImpl()
|
protected void setupCollaborationSiteTestDataImpl()
|
||||||
{
|
{
|
||||||
// create collaboration site
|
// create collaboration site
|
||||||
siteService.createSite("preset", COLLAB_SITE_ID, "title", "description", SiteVisibility.PRIVATE);
|
String collabSiteId = GUID.generate();
|
||||||
|
siteService.createSite("preset", collabSiteId, "title", "description", SiteVisibility.PRIVATE);
|
||||||
NodeRef documentLibrary = SiteServiceImpl.getSiteContainer(
|
NodeRef documentLibrary = SiteServiceImpl.getSiteContainer(
|
||||||
COLLAB_SITE_ID,
|
collabSiteId,
|
||||||
SiteService.DOCUMENT_LIBRARY,
|
SiteService.DOCUMENT_LIBRARY,
|
||||||
true,
|
true,
|
||||||
siteService,
|
siteService,
|
||||||
|
Reference in New Issue
Block a user