RM-6904 code review changes

This commit is contained in:
rlucanu
2019-08-14 17:54:37 +03:00
parent aed9a1abd1
commit ef79db9665

View File

@@ -214,14 +214,14 @@ public class FrozenAspect extends BaseBehaviourBean
) )
public void onMoveNode(final ChildAssociationRef oldChildAssocRef, final ChildAssociationRef newChildAssocRef) public void onMoveNode(final ChildAssociationRef oldChildAssocRef, final ChildAssociationRef newChildAssocRef)
{ {
AuthenticationUtil.runAs((RunAsWork<Void>) () -> { AuthenticationUtil.runAsSystem((RunAsWork<Void>) () -> {
if (nodeService.exists(newChildAssocRef.getParentRef()) && if (nodeService.exists(newChildAssocRef.getParentRef()) &&
nodeService.exists(newChildAssocRef.getChildRef())) nodeService.exists(newChildAssocRef.getChildRef()))
{ {
throw new AccessDeniedException("Frozen nodes can not be moved."); throw new AccessDeniedException("Frozen nodes can not be moved.");
} }
return null; return null;
}, AuthenticationUtil.getSystemUserName()); });
} }
/** /**
@@ -279,13 +279,13 @@ public class FrozenAspect extends BaseBehaviourBean
) )
public void beforeCopy(QName classRef, NodeRef sourceNodeRef, NodeRef targetNodeRef) public void beforeCopy(QName classRef, NodeRef sourceNodeRef, NodeRef targetNodeRef)
{ {
AuthenticationUtil.runAs((RunAsWork<Void>) () -> { AuthenticationUtil.runAsSystem((RunAsWork<Void>) () -> {
if (nodeService.exists(sourceNodeRef) && freezeService.isFrozen(sourceNodeRef)) if (nodeService.exists(sourceNodeRef) && freezeService.isFrozen(sourceNodeRef))
{ {
throw new AccessDeniedException("Frozen nodes can not be copied."); throw new AccessDeniedException("Frozen nodes can not be copied.");
} }
return null; return null;
}, AuthenticationUtil.getSystemUserName()); });
} }
} }