You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is, when I want to add a new policy to this permission, I have to fetch all it's current policies first, then add new policy id to this list, before adding the whole list to update payload. Something like this:
constpermission=awaitthis.keycloakAdminClient.clients.findOnePermission({id: resourceServer.id,permissionId: exist.id,
type,});// Get current policies of permissionconstpolicies=permission.policies;// Add new policypolicies.push(newId);awaitthis.keycloakAdminClient.clients.updatePermission({id: resourceServer.id,permissionId: exist.id,type: permission.type,},// update the whole current policies{ policies },);
I think this is not optimize in term of memory, for example when there is hundreds or thousands policies attached into a permission. And it is not an atomic update.
Is there a function/api which only add a policy to or delete a policy from a permission?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hi. I'm using Keycloak NodeJS admin client (
@keycloak/keycloak-admin-client)To update policies of a permission, I use
updatePermission:The problem is, when I want to add a new policy to this permission, I have to fetch all it's current policies first, then add new policy id to this list, before adding the whole list to update payload. Something like this:
I think this is not optimize in term of memory, for example when there is hundreds or thousands policies attached into a permission. And it is not an atomic update.
Is there a function/api which only add a policy to or delete a policy from a permission?
All reactions