mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +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:
@@ -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