mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -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;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user