Change in ovirt-engine[master]: core: Make CommandHelper.canDoAction accept CommandContext

tnisan at redhat.com tnisan at redhat.com
Mon Sep 26 15:02:21 UTC 2016


Tal Nisan has submitted this change and it was merged.

Change subject: core: Make CommandHelper.canDoAction accept CommandContext
......................................................................


core: Make CommandHelper.canDoAction accept CommandContext

Currently, the CommandHelper gets ExecutionContext, which lacks the
session ID of the caller command. Building the command without a
session ID, resulting in having the command without a user in its context.

This can cause an unexpected behaviour in some cases, where command
validations rely on the currnt user.

When developers uses CommandHelper.canDoAction, they don't need to worry
about that- they should just clone the command's context and run
CommandHelper.canDoAction.

This patch changes the signature of CommandHelper.canDoAction, to get a
CommandContext.

Change-Id: I48e213de4a15480047952a7911de93b4076c040b
Related-To: https://bugzilla.redhat.com/64378
Signed-off-by: Amit Aviram <aaviram at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/image/UploadDiskImageCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandHelper.java
2 files changed, 3 insertions(+), 6 deletions(-)

Approvals:
  Jenkins CI: Passed CI tests
  Amit Aviram: Verified
  Moti Asayag: Looks good to me, approved



-- 
To view, visit https://gerrit.ovirt.org/64383
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I48e213de4a15480047952a7911de93b4076c040b
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list