RM-1464 (Item can be added to hold the user has no file permissions for)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@72192 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-05-28 20:56:31 +00:00
parent c7539a8a66
commit 67a92d96f7
2 changed files with 49 additions and 5 deletions

View File

@@ -147,7 +147,7 @@ public class HoldServiceImplTest extends BaseRMTestCase
});
}
public void testAddRecordFolderOrRecordToHoldWithoutFilingPermission()
public void testAddRecordFolderToHoldWithoutFilingPermissionOnRecordFolder()
{
// Create hold
final NodeRef hold = holdService.createHold(filePlan, "hold one", "I have my reasons", "but I'll not describe them here!");
@@ -181,4 +181,38 @@ public class HoldServiceImplTest extends BaseRMTestCase
}, userName);
}
public void testAddRecordFolderToHoldWithoutFilingPermissionOnHold()
{
// Create hold
final NodeRef hold = holdService.createHold(filePlan, "hold one", "I have my reasons", "but I'll not describe them here!");
assertNotNull(hold);
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 read permissions on the hold
permissionService.setPermission(hold, userName, RMPermissionModel.READ_RECORDS, true);
// Give the user filing permissions on the record folder
permissionService.setPermission(rmFolder, userName, RMPermissionModel.FILING, true);
return null;
}
}, "admin");
doTestInTransaction(new FailureTest(AlfrescoRuntimeException.class)
{
@Override
public void run() throws Exception
{
holdService.addToHold(hold, rmFolder);
}
}, userName);
}
}