Skip to content

Commit

Permalink
Only allow managers
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis-Cruz committed Sep 12, 2024
1 parent b23261d commit a661045
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ public class UserResource extends BennuRestResource {
public JsonElement findUser(@QueryParam("query") String query,
@QueryParam("includeInactive") @DefaultValue("false") Boolean includeInactive,
@QueryParam("maxHits") @DefaultValue("20") Integer maxHits) {
if (query == null || Authenticate.getUser() == null) {
if (query == null) {
throw new WebApplicationException(Status.BAD_REQUEST);
}
accessControl(Group.managers());
Stream<User> results =
Stream.concat(Stream.of(User.findByUsername(query)),
UserProfile.searchByName(query, Integer.MAX_VALUE).map(UserProfile::getUser)).filter(Objects::nonNull)
Expand Down

0 comments on commit a661045

Please sign in to comment.