User to User Relationship

Support MB Relationships User to User Relationship

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #44054
    SridharSridhar
    Participant

    Trying to help a user.

    The requirement is to create a relationship between users of a specific user role and users of another specific role.

    Ex.: manager and employee are custom user roles duplicated from editor and subscriber respectively.

    When a manager user is being edited, selecting 1 or more employees should be possible.

    When an employee user is being edited, they should be able only to see their manager but not edit their manager.

    I created a test relationship called "Manager to Employee" and at From → Field, specified role => manager as the query argument. At To → Field, role => employee.

    Two problems.

    1. The custom meta box appears for users of all user roles. Is the functionality provided by https://docs.metabox.io/extensions/meta-box-include-exclude/ not available when using MB AIO?

    2. Connects To and Connected From both appear when a user is being edited.

    Then I scrapped the Relationship approach and instead created "Manager Fields" field group whose Location = User role of manager.

    Screenshots:
    https://d.pr/i/V6ywzt
    https://d.pr/i/LRop4k

    But when a manager user is being edited, I don't see the Meta Box: https://markuphero.com/share/jq1i7gtlFaA7ugrAWM8B

    Please advise.

    #44057
    PeterPeter
    Moderator

    Hello Sridhar,

    1. The extension MB Include Exclude doesn't work with MB Relationships. The relationship box will display in all user roles.

    2. Then you use the field group with the field type user. In this case, the MB Include Exclude will work but the field type user doesn't have the feature bi-directional like the MB Relationship extension. That means you need to manually select the related editor when editing the subscriber and vice versa.
    If you want to display a field group when editing a user role only, please use the option Edited user role. Screenshot https://imgur.com/9qBei7t

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