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); > bare in mind that if i use the method at SyncUsers.java, I will perform a r no... you only fetch it without group at that point, so you should have no information at all, same as in search. this canDoAction is redundant anyway, as it is called only post search and can fail late... there is no sense in failing it early so I suggest remove this check. even if you still have this check it should just query existence, no groups. only two methods to query principals: fetchPrincipal - login sync all other code should be removed. 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