mirror of
https://github.com/keycloak/keycloak.git
synced 2025-12-20 14:00:09 -06:00
fix: do not re-neable AuthorizationService if it is already enabled
The enable action needs the realm-wide "modify client" permission, which restricted admins with the fine-grained-authz feature do not have. This causes a "forbidden" exception when try try to save a client with Authorization already enabled, even if the "enable" action does nothing since it was already enabled. Fixes #22938 Signed-off-by: Vojtěch Boček <vbocek@gmail.com>
This commit is contained in:
committed by
Pedro Igor
parent
302fa3db08
commit
cd4543456e
@@ -64,8 +64,10 @@ public class AuthorizationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void enable(boolean newClient) {
|
public void enable(boolean newClient) {
|
||||||
|
if (!isEnabled()) {
|
||||||
this.resourceServer = getResourceServerService().create(newClient);
|
this.resourceServer = getResourceServerService().create(newClient);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void disable() {
|
public void disable() {
|
||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user