Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: user query parameter must include username [DHIS2-18748] #19611

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
import org.hisp.dhis.security.acl.AclService;
import org.hisp.dhis.system.util.ReflectionUtils;
import org.hisp.dhis.user.CurrentUser;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserDetails;
import org.hisp.dhis.user.UserSettingsService;
import org.hisp.dhis.webapi.mvc.annotation.ApiVersion;
Expand Down Expand Up @@ -242,7 +243,7 @@ protected List<UID> getPreQueryMatches(P params) throws ConflictException {
@Nonnull
protected List<Criterion> getAdditionalFilters(P params) throws ConflictException {
List<Criterion> filters = new ArrayList<>();
if (params.getQuery() != null && !params.getQuery().isEmpty())
if (params.getQuery() != null && !params.getQuery().isEmpty() && getEntityClass() != User.class)
filters.add(Restrictions.query(getSchema(), params.getQuery()));
List<UID> matches = getPreQueryMatches(params);
// Note: null = no special filters, empty = no matches for special filters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ public static final class GetUserObjectListParams extends GetObjectListParams {

@JsonIgnore
boolean isUsingAnySpecialFilters() {
return phoneNumber != null
return getQuery() != null
|| phoneNumber != null
|| canManage
|| authSubset
|| lastLogin != null
Expand Down
Loading