Ensure master realm can't be removed

Fixes #28896

Signed-off-by: vramik <vramik@redhat.com>
This commit is contained in:
vramik 2024-05-12 13:44:34 +02:00 committed by Pedro Igor
parent 6fbe207d64
commit fbdaf03972

View file

@ -486,7 +486,7 @@ public class RealmAdminResource {
auth.realm().requireManageRealm(); auth.realm().requireManageRealm();
if (Config.getAdminRealm().equals(realm.getName())) { if (Config.getAdminRealm().equals(realm.getName())) {
throw ErrorResponse.error("Can't rename master realm", Status.BAD_REQUEST); throw ErrorResponse.error("Can't remove master realm", Status.BAD_REQUEST);
} }
if (!new RealmManager(session).removeRealm(realm)) { if (!new RealmManager(session).removeRealm(realm)) {