mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-1429 (The user with read-only permissions on the item can unfreeze it via deleting hold)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@72349 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -418,12 +418,11 @@ public class HoldServiceImpl extends ServiceBaseImpl
|
||||
throw new AlfrescoRuntimeException("Can't delete hold, becuase passed node is not a hold. (hold=" + hold.toString() + ")");
|
||||
}
|
||||
|
||||
/*
|
||||
List<NodeRef> held = getHeld(hold);
|
||||
List<String> heldNames = new ArrayList<String>();
|
||||
for (NodeRef nodeRef : held)
|
||||
{
|
||||
if (permissionService.hasPermission(hold, RMPermissionModel.FILING) == AccessStatus.ALLOWED)
|
||||
if (permissionService.hasPermission(nodeRef, RMPermissionModel.FILING) == AccessStatus.DENIED)
|
||||
{
|
||||
heldNames.add((String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME));
|
||||
}
|
||||
@@ -435,11 +434,12 @@ public class HoldServiceImpl extends ServiceBaseImpl
|
||||
for (String name : heldNames)
|
||||
{
|
||||
sb.append("\n ");
|
||||
sb.append("'");
|
||||
sb.append(name);
|
||||
sb.append("'");
|
||||
}
|
||||
throw new AlfrescoRuntimeException("Can't delete hold, because filing permissions for the following items are needed: " + sb.toString());
|
||||
}
|
||||
*/
|
||||
|
||||
// delete the hold node
|
||||
nodeService.deleteNode(hold);
|
||||
|
@@ -360,4 +360,40 @@ public class HoldServiceImplTest extends BaseRMTestCase
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testDeleteHoldWithoutPermissionsOnChildren()
|
||||
{
|
||||
// Create the test hold
|
||||
final NodeRef hold = createAndCheckHold();
|
||||
|
||||
doTestInTransaction(new Test<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void run() throws Exception
|
||||
{
|
||||
// Add the user to the RM Manager role
|
||||
filePlanRoleService.assignRoleToAuthority(filePlan, ROLE_NAME_RECORDS_MANAGER, userName);
|
||||
|
||||
// Give the user filing permissions on the hold
|
||||
permissionService.setPermission(hold, userName, RMPermissionModel.FILING, true);
|
||||
|
||||
// Give the user read permissions on the record folder
|
||||
permissionService.setPermission(rmFolder, userName, RMPermissionModel.READ_RECORDS, true);
|
||||
|
||||
// Add record folder to the hold
|
||||
holdService.addToHold(hold, rmFolder);
|
||||
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
doTestInTransaction(new FailureTest(AlfrescoRuntimeException.class)
|
||||
{
|
||||
@Override
|
||||
public void run() throws Exception
|
||||
{
|
||||
holdService.deleteHold(hold);
|
||||
}
|
||||
}, userName);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user