Yair Zaslavsky has posted comments on this change.
Change subject: core: Simple parameters for add and remove users
......................................................................
Patch Set 6:
(3 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveGroupCommand.java
Line 32: // Remove the permissions of the group:
Line 33: for (permissions permission :
getPermissionDAO().getAllDirectPermissionsForAdElement(id)) {
Line 34: PermissionsOperationsParameters param = new
PermissionsOperationsParameters(permission);
Line 35: param.setSessionId(getParameters().getSessionId());
Line 36:
getBackend().runInternalAction(VdcActionType.RemovePermission,
Looks like some sort of an overhead to me - to invoke the internal command here.
I understand this was done for code re-use, but maybe code re-use should be
done differently?
Line 37: param,
Line 38:
ExecutionHandler.createDefaultContexForTasks(getExecutionContext()));
Line 39: }
Line 40:
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveUserCommand.java
Line 46: .getPermissionDao()
Line 47: .getAllDirectPermissionsForAdElement(id)) {
Line 48: PermissionsOperationsParameters tempVar = new
PermissionsOperationsParameters(permission);
Line 49: tempVar.setShouldBeLogged(false);
Line 50:
Backend.getInstance().runInternalAction(VdcActionType.RemovePermission,
Ok, now I understand why you used an internal command for RemoveGroupCommand.
I still don't like it that much - this should be revisited.
I don't mind to do it later, if you add a nice "todo" comment.
Line 51: tempVar,
Line 52:
ExecutionHandler.createDefaultContexForTasks(getExecutionContext()));
Line 53: }
Line 54:
Line 62: protected boolean canDoAction() {
Line 63: // Get the identifier of the user to be removed from the
parameters:
Line 64: Guid id = getParameters().getId();
Line 65:
Line 66: // Check that we are not trying to remove the builting admin
user:
s/builting/built-in ?
Line 67: if (PredefinedUsers.ADMIN_USER.getId().equals(id)) {
Line 68:
addCanDoActionMessage(VdcBllMessages.USER_CANNOT_REMOVE_ADMIN_USER);
Line 69: return false;
Line 70: }
--
To view, visit http://gerrit.ovirt.org/19480
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I5c37a686b28f38ce47e9a7d590e3f706164dc09c
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Liran Zelkha <[email protected]>
Gerrit-Reviewer: Martin Peřina <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches