use logged in realm as default (#22460)

This commit is contained in:
Erik Jan de Wit 2023-08-16 20:29:07 +02:00 committed by GitHub
parent b216895baf
commit b4650b7742
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,7 +231,7 @@ public class AdminConsole {
if (createRealmRole != null) { if (createRealmRole != null) {
createRealm = user.hasRole(createRealmRole); createRealm = user.hasRole(createRealmRole);
} }
addMasterRealmAccess(user, currentRealm, realmAccess); addMasterRealmAccess(user, currentRealm != null ? currentRealm : realm.getName(), realmAccess);
} else { } else {
logger.debug("setting up realm access for a realm user"); logger.debug("setting up realm access for a realm user");
addRealmAccess(realm, user, realmAccess); addRealmAccess(realm, user, realmAccess);