RM-1560: User with Remove from Hold capability can't remove from hold

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@74510 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2014-06-24 07:27:48 +00:00
parent 7aed13d0fb
commit 4159f367ad

View File

@@ -639,7 +639,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
if (holds != null && !holds.isEmpty()) if (holds != null && !holds.isEmpty())
{ {
for (NodeRef hold : holds) for (final NodeRef hold : holds)
{ {
if (!instanceOf(hold, TYPE_HOLD)) if (!instanceOf(hold, TYPE_HOLD))
{ {
@@ -648,8 +648,18 @@ public class HoldServiceImpl extends ServiceBaseImpl
if (getHeld(hold).contains(nodeRef)) if (getHeld(hold).contains(nodeRef))
{ {
// remove from hold // run as system so we don't run into further permission issues
nodeService.removeChild(hold, nodeRef); // we already know we have to have the correct capability to get here
runAsSystem(new RunAsWork<Void>()
{
@Override
public Void doWork()
{
// remove from hold
nodeService.removeChild(hold, nodeRef);
return null;
}
});
} }
} }