Add role to user

Hello!

I am running an action in the client to add/remove roles to a user. The action is triggered by the user using an icon button. The console looks fine. However, the change is not reflected in Dev Tools (e.g. current user roles) nor the UI until I refresh the browser. I saw a few older posts referencing the same issue. I this still a known problem?

1 Like

Hi!

Are you adding Roles to your own account, or another account?

For you own account, the Current User Roles should reflect your roles (not other Users’ roles). However, it makes sense that you must refresh, as changing your roles might affect if you actually have access to the app you are in (refresh re-enforces new roles). You cannot see other users roles directly in the devtools I believe.

I believe the old issue you were referring to was some delay from e.g. adding roles to user A, until user A got the new role / access and were able to log in.

I initially tried adding the role to another user, however the UI did not reflect it. Thus, I used my own account to allow me to check dev tools.

1 Like

I have experienced the same issue where new roles added (or removed) from a user were not reflected in DevTools or in the app’s UI. Refreshing did not help.

Usually it resolved after waiting a bit, so it seems to be a delay. The length of the delay varied — sometimes it was instant, other times it took several minutes.

1 Like

@kristian Are the role changes applied immediately, and it’s just the UI that takes time to reflect them? Or is the add/remove operation itself delayed?

Assuming the role change happens right away, let’s say I update the role of another user (use case for my feature). Since that’s a server-side change, I’d expect the UI to show it immediately once the update succeeds. Is that a UI sync limitation, or could it be improved so the displayed roles refresh automatically?

It’s annoying to have to refresh before visually showing that the user’s roles have changed, especially since the update is already applied on the server and the affected user will notice it when they open the app (unrelated to if I have refreshed).

1 Like

Same issue here, a “subscribe to updates” on user roles would be nice. Current workaround used when the UI requires it is to reflect the user roles with boolean attributes on the person object connected to the user.

3 Likes