RM-7068 updates from review

This commit is contained in:
Sara Aspery
2019-11-28 17:07:20 +00:00
parent fe502aadec
commit 976748ee0f
2 changed files with 2 additions and 9 deletions

View File

@@ -552,14 +552,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
*/ */
private void checkPermissionsForDeleteHold(NodeRef hold) private void checkPermissionsForDeleteHold(NodeRef hold)
{ {
List<NodeRef> held = AuthenticationUtil.runAsSystem(new RunAsWork<List<NodeRef>>() List<NodeRef> held = AuthenticationUtil.runAsSystem(() -> getHeld(hold));
{
@Override
public List<NodeRef> doWork()
{
return getHeld(hold);
}
});
List<String> heldNames = new ArrayList<>(); List<String> heldNames = new ArrayList<>();
for (NodeRef nodeRef : held) for (NodeRef nodeRef : held)

View File

@@ -320,7 +320,7 @@ public class HoldServiceImplUnitTest extends BaseUnitTest
// TODO check interactions with policy component!!! // TODO check interactions with policy component!!!
} }
@Test (expected = AlfrescoRuntimeException.class) @Test (expected = AccessDeniedException.class)
public void deleteHoldNoPermissionsOnContent() public void deleteHoldNoPermissionsOnContent()
{ {
mockPoliciesForDeleteHold(); mockPoliciesForDeleteHold();