mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
MNT22138: Document Filed to RM File Plan under categories with cut off retention schedule no longer accessible to non admin users in collab site
- Added fix for issue cought by ui tests
This commit is contained in:
@@ -132,8 +132,15 @@ public class DispositionScheduleImpl implements DispositionSchedule,
|
|||||||
public DispositionActionDefinition getDispositionActionDefinition(String id)
|
public DispositionActionDefinition getDispositionActionDefinition(String id)
|
||||||
{
|
{
|
||||||
if (this.actions == null)
|
if (this.actions == null)
|
||||||
|
{
|
||||||
|
authenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork<Void>()
|
||||||
|
{
|
||||||
|
public Void doWork() throws Exception
|
||||||
{
|
{
|
||||||
getDispositionActionsImpl();
|
getDispositionActionsImpl();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
DispositionActionDefinition actionDef = this.actionsById.get(id);
|
DispositionActionDefinition actionDef = this.actionsById.get(id);
|
||||||
|
@@ -27,16 +27,6 @@
|
|||||||
|
|
||||||
package org.alfresco.module.org_alfresco_module_rm.disposition;
|
package org.alfresco.module.org_alfresco_module_rm.disposition;
|
||||||
|
|
||||||
import static org.apache.commons.lang3.BooleanUtils.isNotTrue;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementPolicies;
|
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementPolicies;
|
||||||
@@ -73,6 +63,11 @@ import org.alfresco.util.ParameterCheck;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import static org.apache.commons.lang3.BooleanUtils.isNotTrue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disposition service implementation.
|
* Disposition service implementation.
|
||||||
*
|
*
|
||||||
@@ -439,27 +434,31 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
|||||||
*/
|
*/
|
||||||
private NodeRef getAssociatedDispositionScheduleImpl(NodeRef nodeRef)
|
private NodeRef getAssociatedDispositionScheduleImpl(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
NodeRef result = null;
|
|
||||||
ParameterCheck.mandatory("nodeRef", nodeRef);
|
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||||
|
|
||||||
|
return authenticationUtil.runAsSystem(new RunAsWork<NodeRef>()
|
||||||
|
{
|
||||||
|
public NodeRef doWork() throws Exception
|
||||||
|
{
|
||||||
|
NodeRef result = null;
|
||||||
// Make sure we are dealing with an RM node
|
// Make sure we are dealing with an RM node
|
||||||
if (!filePlanService.isFilePlanComponent(nodeRef))
|
if (!filePlanService.isFilePlanComponent(nodeRef))
|
||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException("Can not find the associated retention schedule for a non records management component. (nodeRef=" + nodeRef.toString() + ")");
|
throw new AlfrescoRuntimeException("Can not find the associated retention schedule for a non records management component. (nodeRef=" + nodeRef.toString() + ")");
|
||||||
}
|
}
|
||||||
|
if (nodeService.hasAspect(nodeRef, ASPECT_SCHEDULED))
|
||||||
if (this.nodeService.hasAspect(nodeRef, ASPECT_SCHEDULED))
|
|
||||||
{
|
{
|
||||||
List<ChildAssociationRef> childAssocs = this.nodeService.getChildAssocs(nodeRef, ASSOC_DISPOSITION_SCHEDULE, RegexQNamePattern.MATCH_ALL);
|
List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(nodeRef, ASSOC_DISPOSITION_SCHEDULE, RegexQNamePattern.MATCH_ALL);
|
||||||
if (!childAssocs.isEmpty())
|
if (!childAssocs.isEmpty())
|
||||||
{
|
{
|
||||||
ChildAssociationRef firstChildAssocRef = childAssocs.get(0);
|
ChildAssociationRef firstChildAssocRef = childAssocs.get(0);
|
||||||
result = firstChildAssocRef.getChildRef();
|
result = firstChildAssocRef.getChildRef();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService#getAssociatedRecordsManagementContainer(org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule)
|
* @see org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService#getAssociatedRecordsManagementContainer(org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule)
|
||||||
@@ -894,14 +893,15 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
|||||||
@Override
|
@Override
|
||||||
public boolean isNextDispositionActionEligible(NodeRef nodeRef)
|
public boolean isNextDispositionActionEligible(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
|
// Get the disposition instructions
|
||||||
|
DispositionSchedule di = getDispositionSchedule(nodeRef);
|
||||||
|
DispositionAction nextDa = getNextDispositionAction(nodeRef);
|
||||||
return authenticationUtil.runAsSystem(new RunAsWork<Boolean>()
|
return authenticationUtil.runAsSystem(new RunAsWork<Boolean>()
|
||||||
{
|
{
|
||||||
public Boolean doWork() throws Exception
|
public Boolean doWork() throws Exception
|
||||||
{
|
{
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
// Get the disposition instructions
|
|
||||||
DispositionSchedule di = getDispositionSchedule(nodeRef);
|
|
||||||
DispositionAction nextDa = getNextDispositionAction(nodeRef);
|
|
||||||
if (di != null &&
|
if (di != null &&
|
||||||
nodeService.hasAspect(nodeRef, ASPECT_DISPOSITION_LIFECYCLE) &&
|
nodeService.hasAspect(nodeRef, ASPECT_DISPOSITION_LIFECYCLE) &&
|
||||||
nextDa != null) {
|
nextDa != null) {
|
||||||
@@ -1218,7 +1218,15 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
|||||||
public Date getDispositionActionDate(NodeRef record, NodeRef dispositionSchedule, String dispositionActionName)
|
public Date getDispositionActionDate(NodeRef record, NodeRef dispositionSchedule, String dispositionActionName)
|
||||||
{
|
{
|
||||||
DispositionSchedule ds = new DispositionScheduleImpl(serviceRegistry, nodeService, dispositionSchedule);
|
DispositionSchedule ds = new DispositionScheduleImpl(serviceRegistry, nodeService, dispositionSchedule);
|
||||||
List<ChildAssociationRef> assocs = nodeService.getChildAssocs(dispositionSchedule);
|
List<ChildAssociationRef> assocs = AuthenticationUtil.runAsSystem(new RunAsWork<List<ChildAssociationRef> >()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public List<ChildAssociationRef> doWork()
|
||||||
|
{
|
||||||
|
return nodeService.getChildAssocs(dispositionSchedule);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (assocs != null && !assocs.isEmpty())
|
if (assocs != null && !assocs.isEmpty())
|
||||||
{
|
{
|
||||||
for (ChildAssociationRef assoc : assocs)
|
for (ChildAssociationRef assoc : assocs)
|
||||||
@@ -1226,8 +1234,15 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
|||||||
if (assoc != null && assoc.getQName().getLocalName().contains(dispositionActionName))
|
if (assoc != null && assoc.getQName().getLocalName().contains(dispositionActionName))
|
||||||
{
|
{
|
||||||
DispositionActionDefinition actionDefinition = ds.getDispositionActionDefinition(assoc.getChildRef().getId());
|
DispositionActionDefinition actionDefinition = ds.getDispositionActionDefinition(assoc.getChildRef().getId());
|
||||||
|
|
||||||
|
return authenticationUtil.runAsSystem(new RunAsWork<Date>()
|
||||||
|
{
|
||||||
|
public Date doWork() throws Exception
|
||||||
|
{
|
||||||
return calculateAsOfDate(record, actionDefinition);
|
return calculateAsOfDate(record, actionDefinition);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
Reference in New Issue
Block a user