Check whether CREATE_REALM role exists in realm role mappings before hasRole check for user.
Closes #20332
This commit is contained in:
parent
f526f7a091
commit
41e253c054
1 changed files with 4 additions and 1 deletions
|
@ -227,7 +227,10 @@ public class AdminConsole {
|
||||||
boolean createRealm = false;
|
boolean createRealm = false;
|
||||||
if (realm.equals(masterRealm)) {
|
if (realm.equals(masterRealm)) {
|
||||||
logger.debug("setting up realm access for a master realm user");
|
logger.debug("setting up realm access for a master realm user");
|
||||||
createRealm = user.hasRole(masterRealm.getRole(AdminRoles.CREATE_REALM));
|
RoleModel createRealmRole = masterRealm.getRole(AdminRoles.CREATE_REALM);
|
||||||
|
if (createRealmRole != null) {
|
||||||
|
createRealm = user.hasRole(createRealmRole);
|
||||||
|
}
|
||||||
addMasterRealmAccess(user, realmAccess);
|
addMasterRealmAccess(user, realmAccess);
|
||||||
} else {
|
} else {
|
||||||
logger.debug("setting up realm access for a realm user");
|
logger.debug("setting up realm access for a realm user");
|
||||||
|
|
Loading…
Reference in a new issue