KEYCLOAK-19536 Removal of client creates new instance of provider for each client role

This commit is contained in:
vramik 2021-10-12 16:28:05 +02:00 committed by Hynek Mlnařík
parent a4f83c569d
commit dacf28af84
3 changed files with 4 additions and 3 deletions

View file

@ -26,6 +26,7 @@ import org.keycloak.models.RealmProviderFactory;
import javax.persistence.EntityManager;
import org.keycloak.models.ClientModel;
import org.keycloak.models.RealmModel;
import org.keycloak.models.RealmProvider;
import org.keycloak.models.RoleContainerModel;
import org.keycloak.models.RoleContainerModel.RoleRemovedEvent;
import org.keycloak.models.RoleModel;
@ -83,7 +84,7 @@ public class JpaRealmProviderFactory implements RealmProviderFactory, ProviderEv
} else {
return;
}
create(e.getKeycloakSession()).preRemove(realm, role);
((JpaRealmProvider) e.getKeycloakSession().getProvider(RealmProvider.class)).preRemove(realm, role);
}
}

View file

@ -81,7 +81,7 @@ public class MapClientProviderFactory extends AbstractMapProviderFactory<ClientP
} else {
return;
}
create(e.getKeycloakSession()).preRemove(realm, role);
((MapClientProvider) e.getKeycloakSession().getProvider(ClientProvider.class)).preRemove(realm, role);
}
}
}

View file

@ -79,7 +79,7 @@ public class MapGroupProviderFactory extends AbstractMapProviderFactory<GroupPro
} else {
return;
}
create(e.getKeycloakSession()).preRemove(realm, role);
((MapGroupProvider) e.getKeycloakSession().getProvider(GroupProvider.class)).preRemove(realm, role);
}
}
}