Change WordPress user roles and capabilities Forums New Feature Request Restrict "other role" to only 1 choice?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5746
    kymera
    Spectator

    On our site we have many roles, but only one of those roles is allowed to be applied to users with another role.

    For example, we have the following roles.
    Role 1
    Role 2
    Role 3
    Role A

    Role A can optionally be paired with any other role. But roles 1-3 HAVE to be a primary role.

    We were under the impression from this post that if we purchased the pro version we could do this, but the how to guide seems to be for something else.

    Is this possible?
    Thanks

    #5750
    Vladimir
    Keymaster

    Mentioned guide is about restriction of access of user with selected role to other roles during new user creation or user editing.

    URE Pro does not realize any filters for which roles can be granted as primary or which roles can be granted as others only.

    More, WordPress does not realize any special attribute to differ primary and other roles granted to user. There are just a list of roles, PHP array. 1st role in that list is counted as primary role. If you revoke that role from a user, role which was 2nd in the roles list for this user, will become 1st, or by other words – primary. WordPress checks user permissions by simple sum of all capabilities from all roles assigned to a user.

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