mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-1007: Couldn't Freeze the folder/record by any user except RM admin
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@56185 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -593,10 +593,8 @@ public class FreezeServiceImpl extends ServiceBaseImpl
|
|||||||
*/
|
*/
|
||||||
private NodeRef createHold(NodeRef nodeRef, String reason)
|
private NodeRef createHold(NodeRef nodeRef, String reason)
|
||||||
{
|
{
|
||||||
NodeRef holdNodeRef = null;
|
|
||||||
|
|
||||||
// get the hold container
|
// get the hold container
|
||||||
NodeRef root = filePlanService.getFilePlan(nodeRef);
|
final NodeRef root = filePlanService.getFilePlan(nodeRef);
|
||||||
NodeRef holdContainer = filePlanService.getHoldContainer(root);
|
NodeRef holdContainer = filePlanService.getHoldContainer(root);
|
||||||
|
|
||||||
// calculate the hold name
|
// calculate the hold name
|
||||||
@@ -610,7 +608,7 @@ public class FreezeServiceImpl extends ServiceBaseImpl
|
|||||||
|
|
||||||
// create the hold object
|
// create the hold object
|
||||||
QName holdQName = QName.createQName(RM_URI, holdName);
|
QName holdQName = QName.createQName(RM_URI, holdName);
|
||||||
holdNodeRef = nodeService.createNode(holdContainer, ContentModel.ASSOC_CONTAINS, holdQName, TYPE_HOLD, holdProps).getChildRef();
|
final NodeRef holdNodeRef = nodeService.createNode(holdContainer, ContentModel.ASSOC_CONTAINS, holdQName, TYPE_HOLD, holdProps).getChildRef();
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
||||||
@@ -619,10 +617,19 @@ public class FreezeServiceImpl extends ServiceBaseImpl
|
|||||||
logger.debug(msg.toString());
|
logger.debug(msg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// set inherit to false
|
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||||
permissionService.setInheritParentPermissions(holdNodeRef, false);
|
{
|
||||||
String allGroup = filePlanRoleService.getAllRolesContainerGroup(root);
|
@Override
|
||||||
permissionService.setPermission(holdNodeRef, allGroup, RMPermissionModel.FILING, true);
|
public Void doWork() throws Exception
|
||||||
|
{
|
||||||
|
// set inherit to false
|
||||||
|
permissionService.setInheritParentPermissions(holdNodeRef, false);
|
||||||
|
String allGroup = filePlanRoleService.getAllRolesContainerGroup(root);
|
||||||
|
permissionService.setPermission(holdNodeRef, allGroup, RMPermissionModel.FILING, true);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Bind the hold node reference to the transaction
|
// Bind the hold node reference to the transaction
|
||||||
AlfrescoTransactionSupport.bindResource(KEY_HOLD_NODEREF, holdNodeRef);
|
AlfrescoTransactionSupport.bindResource(KEY_HOLD_NODEREF, holdNodeRef);
|
||||||
|
Reference in New Issue
Block a user