mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-08 14:32:05 -03:30
Use KeycloakModelUtils to resolve groups by path
Closes #45072 Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
This commit is contained in:
parent
43634dd2ed
commit
b567372d20
@ -45,15 +45,8 @@ public abstract class GroupBasedStepProvider implements WorkflowStepProvider {
|
||||
}
|
||||
|
||||
private Stream<GroupModel> getGroups() {
|
||||
return model.getConfig().getOrDefault(CONFIG_GROUP, List.of()).stream().map(this::getGroup);
|
||||
}
|
||||
|
||||
private GroupModel getGroup(String name) {
|
||||
GroupModel group = KeycloakModelUtils.findGroupByPath(session, getRealm(), name);
|
||||
if (group == null) {
|
||||
throw new IllegalStateException("Could not find group for name or path: " + name);
|
||||
}
|
||||
return group;
|
||||
return model.getConfig().getOrDefault(CONFIG_GROUP, List.of()).stream()
|
||||
.map(name -> KeycloakModelUtils.findGroupByPath(session, getRealm(), name));
|
||||
}
|
||||
|
||||
private RealmModel getRealm() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user