186 firstResult = firstResult != null ? firstResult : -1;
187 maxResults = maxResults != null ? maxResults : Constants.DEFAULT_MAX_RESULTS;
189 List<UserRepresentation> results =
new ArrayList<UserRepresentation>();
190 List<UserModel> userModels = Collections.emptyList();
191 if (search != null) {
194 if (userModel != null) {
195 userModels = Arrays.asList(userModel);
200 }
else if (last != null || first != null || email != null || username != null) {
201 Map<String, String> attributes =
new HashMap<String, String>();
203 attributes.put(UserModel.LAST_NAME, last);
206 attributes.put(UserModel.FIRST_NAME, first);
209 attributes.put(UserModel.EMAIL, email);
211 if (username != null) {
212 attributes.put(UserModel.USERNAME, username);
220 boolean briefRepresentationB = briefRepresentation != null && briefRepresentation;
221 for (UserModel
user : userModels) {
223 UserRepresentation userRep = briefRepresentationB
224 ? ModelToRepresentation.toBriefRepresentation(
user)
227 results.add(userRep);
KeycloakSession session
Definition: UsersResource.java:81
AdminPermissionEvaluator auth
Definition: UsersResource.java:73
UserResource user(final @PathParam("id") String id)
Definition: UsersResource.java:146
List< UserModel > searchForUser(String search, RealmModel realm)
static final String SEARCH_ID_PARAMETER
Definition: UsersResource.java:69
Map< String, Boolean > getAccess(UserModel user)
UserPermissionEvaluator users()
List< UserModel > getUsers(RealmModel realm, boolean includeServiceAccounts)
UserModel getUserById(String id, RealmModel realm)
RealmModel realm
Definition: UsersResource.java:71