Michael Pasternak has posted comments on this change. Change subject: restapi: wrong user id in /api/users/<id>/permissions(#890124) ......................................................................
Patch Set 2: I would prefer that you didn't submit this (2 inline comments) please also add a test to validate the id. thanks. .................................................... File backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendAssignedPermissionsResource.java Line 93: Line 94: protected Permissions mapCollection(List<permissions> entities) { Line 95: Permissions collection = new Permissions(); Line 96: for (permissions entity : entities) { Line 97: if (entity.getObjectType() != VdcObjectType.System) { what about removing ^ this condition?, afair you send another patch allowing to see VdcObjectType.System permissions, so this bug will be back there (regression) Line 98: castEveryonePermissionsToUser(entity); Line 99: Permission permission = map(entity, getUserById(entity.getad_element_id())); Line 100: collection.getPermissions().add(addLinks(permission, permission.getUser() != null ? suggestedParentType : Group.class)); Line 101: } Line 106: private void castEveryonePermissionsToUser(permissions entity) { Line 107: if (entity.getad_element_id() != null && Line 108: entity.getad_element_id().equals(Guid.EVERYONE) && Line 109: queryType.equals(VdcQueryType.GetPermissionsByAdElementId)) { Line 110: entity.setad_element_id(((MultilevelAdministrationByAdElementIdParameters) queryParams).getAdElementId()); you should use this.targetId here instead (more readable) Line 111: } Line 112: } Line 113: Line 114: public DbUser getUserById(Guid userId) { -- To view, visit http://gerrit.ovirt.org/10581 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d801cb3c4ad788e984c5338a04ac534d4942601 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ravi Nori <rn...@redhat.com> Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com> Gerrit-Reviewer: Ravi Nori <rn...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches