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:
Tuna Aksoy
2014-05-30 14:13:28 +00:00
parent 86bfb347b9
commit f544bacec6
2 changed files with 39 additions and 3 deletions

View File

@@ -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);
}
}