mirror of
https://github.com/keycloak/keycloak.git
synced 2026-02-12 10:19:13 -06:00
Make sure searches by identifiers are filtered
Closes #38679 Signed-off-by: Pedro Igor <pigor.craveiro@gmail.com>
This commit is contained in:
@@ -138,7 +138,11 @@ public class ClientsResource {
|
||||
} else {
|
||||
ClientModel client = realm.getClientByClientId(clientId);
|
||||
if (client != null) {
|
||||
clientModels = Stream.of(client);
|
||||
if (AdminPermissionsSchema.SCHEMA.isAdminPermissionsEnabled(realm)) {
|
||||
clientModels = Stream.of(client).filter(auth.clients()::canView);
|
||||
} else {
|
||||
clientModels = Stream.of(client);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -303,6 +303,9 @@ public class UsersResource {
|
||||
session.users().getUserById(realm, search.substring(SEARCH_ID_PARAMETER.length()).trim());
|
||||
if (userModel != null) {
|
||||
userModels = Stream.of(userModel);
|
||||
if (AdminPermissionsSchema.SCHEMA.isAdminPermissionsEnabled(realm)) {
|
||||
userModels = userModels.filter(userPermissionEvaluator::canView);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Map<String, String> attributes = new HashMap<>();
|
||||
|
||||
Reference in New Issue
Block a user