Change WordPress user roles and capabilities Forums Bug Reports Multisite > Non-admin user, "Other/Additional Roles" keep getting reset

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #3382
    [email protected]
    Participant

    Hello,

    We have a multisite, where a new site_editor role needs to be assigned to a user, without making super admin or administrator role. When I add the role, via root site’s User>Edit>Assign additional role OR at the Network level and Edit this user, the change doesn’t get applied.

    Each time, the user logs in, they are defaulted to their base role of subscriber. This happens only for the root site.

    For any other subsite, the same process works and the user has editor privileges like they were expected to have on the root site.

    Thanks,
    Shweta

    #3383
    Vladimir
    Keymaster

    Hi Shweta,

    Try to deactivate temporally all plugins at the main(root) site except URE and test if role will be assigned correctly and will be in place after user login. I suppose that some plugin can reassign subscriber to this user at the root site.

    #3903
    [email protected]
    Participant

    Hello Vladimir,

    Revisiting this with an update. We have shibboleth plugin configured to set Primary role to “Subscriber” on each login – so that sort of solved the mystery.

    This time, I have a question for what happens when we do “Update Network”.
    Setup includes
    1) Multisite with roles and users at network level.
    2) There are sub sites, that have users with “Other Roles” set with site-specific roles, and or network level roles. Some sites need roles that should not visible to other sites.

    Test Workflow:
    1) Add a capability to a network level role- “Site Editor”
    2) Update Network

    Expected result is that only the capabilities of that role, for all subsites is updated. The User>Role Assignment is not modified.

    However, after the Update Network, we notice that sub site level user>role assignment is lost.

    Can you please explain what we need to do, so we don’t have users losing roles on sub sites, but we are still able to add/remove capabilities for network level roles.

    Thanks,
    Shweta

    #3908
    Vladimir
    Keymaster

    Hi Shweta,

    There are no network level roles at WordPress. Be aware that when you work with roles at the “Network Admin->Users->User Role Editor”, you work with roles of the main site of a network really. “Network Update” from there overwrites roles of any other subsite of this network with roles from a main site of that network. So any changes made to the roles at subsite are lost after you click ‘Network Update’. All subsites get an exact copy of capabilities and roles from the main site.

    It’s possible to send to subsites just one role from a main site and do not touch any others. Go to the main site “Users->User Role Editor”, select role, turn ON “Apply to All sites” option at the top of a page and click “Update” button. Only current role will be replicated to subsites in this case.

    #3911
    [email protected]
    Participant

    Vladimir,

    Thanks for the clarification. Does the update also include update of roles that are assigned to user on subsites – with the roles that are assigned to users on the main site?

    We had users with site specific roles assigned to them. After a network update, those user’s lost their site specific roles as well as “main site/network” level roles.

    “Apply to all sites” is new or it has always been at the root site level? It would be nice to have it on the network UI if possible. Would you recommend we make modifications to roles/ create etc at the main site level instead of network level?

    Thanks,
    Shweta

    #3913
    Vladimir
    Keymaster

    A list of roles which are assigned to a user at subsite is not updated. But roles specific to a subsite are removed from subsite after the network update saves to subsites the roles from the main site. Older roles are still assigned to a user after the such update, but they are counted and shown as the custom capabilities assigned directly to a user, not as roles, because of these roles do not exist.

    “Apply to all sites” has always been at the root site level. It’s a feature from free version of URE. I do not show this interface element at network UI to not mislead the users having at one page 2 interface elements which are both related to the network role(s) update, but work so differently. May an option ‘Replicate a current role only’ at the opened dialog window will be more suitable in this case. What do you think?

    Select the best strategy of roles update according to your own needs. Just take into account, that data are replicated differently in those cases. If you need to have different roles at subsites comparing to the main site you should not use “Update Network”. So ‘Yes’ it’s better to replicate single role from the main site.

    #3914
    [email protected]
    Participant

    Thank you — that definitely helps me understand the feature better. For any roles/capabilities we want to propagate to subsites, we will enable the “Apply to All Sites”. I just didn’t look at the root site UI earlier.

    I don’t see a use case of using Update Network now, since we would like to maintain user role assignments at subsite level.

    #3916
    [email protected]
    Participant

    As an enhancement, I would suggest that when a user clicks on “Update Network”, there could be a pop up with a warning of what will be overwritten or a link to that information, with a suggestion that if they only want to push updated roles to subsites, then go to Root site and use “Apply to All Sites”.

    Thanks,
    Shweta

    #3917
    Vladimir
    Keymaster

    Hi Shweta,

    Thanks for a suggestion. I will realize it.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.