KEYCLOAK-2026 Fix realm.getMasterAdminClient() in JPA and Mongo models
This commit is contained in:
1 parent
1d5a01577e
commit
ea7709a104
4 files changed
+35
-6
No files matched your search
+7
-1
@@ -1223,7 +1223,13 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
|
||||
@Override
|
||||
public ClientModel getMasterAdminClient() {
|
||||
MongoClientEntity appData = getMongoStore().loadEntity(MongoClientEntity.class, realm.getMasterAdminClient(), invocationContext);
|
||||
return appData != null ? new ClientAdapter(session, this, appData, invocationContext) : null;
|
||||
if (appData == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MongoRealmEntity masterRealm = getMongoStore().loadEntity(MongoRealmEntity.class, appData.getRealmId(), invocationContext);
|
||||
RealmModel masterRealmModel = new RealmAdapter(session, masterRealm, invocationContext);
|
||||
return new ClientAdapter(session, masterRealmModel, appData, invocationContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -453,7 +453,7 @@ public class UserAdapter extends AbstractMongoAdapter<MongoUserEntity> implement
|
||||
|
||||
@Override
|
||||
public Set<GroupModel> getGroups() {
|
||||
if (user.getGroupIds() == null && user.getGroupIds().size() == 0) return Collections.EMPTY_SET;
|
||||
if (user.getGroupIds() == null || user.getGroupIds().size() == 0) return Collections.EMPTY_SET;
|
||||
Set<GroupModel> groups = new HashSet<>();
|
||||
for (String id : user.getGroupIds()) {
|
||||
groups.add(realm.getGroupById(id));
|
||||
|
||||
Reference in new issue
Block a user