mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-1463 (Item the user has read only permissions for can be added to hold in from Records Search results)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@72191 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -20,6 +20,8 @@ package org.alfresco.module.org_alfresco_module_rm.test.service;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
|
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
|
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
|
||||||
@@ -37,6 +39,12 @@ public class HoldServiceImplTest extends BaseRMTestCase
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean isUserTest()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public void testDeleteHoldBehaviourForRecordFolder()
|
public void testDeleteHoldBehaviourForRecordFolder()
|
||||||
{
|
{
|
||||||
doTestInTransaction(new Test<Void>()
|
doTestInTransaction(new Test<Void>()
|
||||||
@@ -139,4 +147,38 @@ public class HoldServiceImplTest extends BaseRMTestCase
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testAddRecordFolderOrRecordToHoldWithoutFilingPermission()
|
||||||
|
{
|
||||||
|
// 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 filing permissions on the hold
|
||||||
|
permissionService.setPermission(hold, userName, RMPermissionModel.FILING, true);
|
||||||
|
|
||||||
|
// Give the user only read permissions on the record folder
|
||||||
|
permissionService.setPermission(rmFolder, userName, RMPermissionModel.READ_RECORDS, true);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}, "admin");
|
||||||
|
|
||||||
|
doTestInTransaction(new FailureTest(AlfrescoRuntimeException.class)
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run() throws Exception
|
||||||
|
{
|
||||||
|
holdService.addToHold(hold, rmFolder);
|
||||||
|
}
|
||||||
|
}, userName);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user