I’ve got an issue for users who are non-admin and had the capabilities to chang/add secondary roles to users. I created another role “user admin” which had basically all the User and the URE capabilities.
With this role, non-admin users could go to a user and then add some role to them.
My issue now is that the “primary role” is not retrieved when non-admin users are accessing the capabilities and then the update removes their primary role, replacing it with the first secondary roles which was granted. Results is that this user do not have the default “subsriber” role and lose some other capabilities.
When changing the “user admin” role and giving it all capabilities -> Bug still there
When giving the user “admin” role -> can retrieve the primary role and update as before.
I was also trying to update the website as per my other requests
according to this topic.
It seems that the code snippet in the post above is solving the current bug : it removes the dropdown to choose the main role, which is fine and also solve this issue. My assumption is that there is no need to display the primary role, hence there are no error to display it, hence there is no change in the dropdown, and the primary role is kept as-is which was my original goals.
I still don’t know why the primary role was not displayed correctly as first, if you want to investigate, feel free to liaise with me