mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-1484 (User with Close Folders capability can't close the folder)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@71004 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -32,6 +32,8 @@ 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.record.RecordService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.util.ServiceBaseImpl;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
@@ -277,7 +279,7 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
|
||||
{
|
||||
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||
|
||||
if (recordService.isRecord(nodeRef))
|
||||
if (isRecord(nodeRef))
|
||||
{
|
||||
ChildAssociationRef assocRef = nodeService.getPrimaryParent(nodeRef);
|
||||
if (assocRef != null)
|
||||
@@ -290,7 +292,18 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
|
||||
{
|
||||
if (!isRecordFolderClosed(nodeRef))
|
||||
{
|
||||
nodeService.setProperty(nodeRef, PROP_IS_CLOSED, true);
|
||||
final NodeRef folderNodeRef = nodeRef;
|
||||
// do the work of creating the record as the system user
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
nodeService.setProperty(folderNodeRef, PROP_IS_CLOSED, true);
|
||||
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user