Alon Bar-Lev has posted comments on this change. Change subject: aaa: reactivate user ......................................................................
Patch Set 1: (1 comment) http://gerrit.ovirt.org/#/c/29974/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddUserCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddUserCommand.java: Line 109: // First check if the user is already in the database, if it is we need to update, if not we need to insert: Line 110: DbUser dbUser = dao.getByExternalId(getParameters().getDirectory(), principal.<String> get(PrincipalRecord.ID)); Line 111: DbUser mappedDbUser = DirectoryUtils.mapPrincipalRecordToDbUser(getParameters().getDirectory(), principal); Line 112: mappedDbUser.setId(dbUser != null ? dbUser.getId() : Guid.newGuid()); Line 113: mappedDbUser.setActive(dbUser != null ? dbUser.isActive() : true); > the command should not care if it was executed from rest-api or gui, the co what I want is: 1. avoid extra directory access. 2. disable validation if not required. from what I understand restapi can use any failure, it can be failure at canDoAction or failure of execute, so the argument of adding validation at canDoAction specifically to restapi is incorrect. if you need to validate anything special in restapi you can always add a new command that perform whatever and call this command, or add a parameter. I do not care if in one patch or more... I am interested in end result. Line 114: Line 115: DirectoryUtils.syncAndReactivatePrincipal(principal, mappedDbUser, "the user is rectivated as it was added again to the system"); Line 116: setActionReturnValue(mappedDbUser.getId()); Line 117: setSucceeded(true); -- To view, visit http://gerrit.ovirt.org/29974 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I556d8da48a858ce193865e84fb6c7cb4043a8e5b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches