Contacts many_to_many relationship with Users - how to use?

If you navigate to Admin -> Studio -> Contacts -> Relationships, you will see that Contacts has a many-to-many relationship with Users. 

I cannot access a contact's users via the API. I've tried `Contacts/:id/link/users`, `Contacts/:id/collection/users`, `Contacts/:id/link/contacts_users`, and `Contacts/:id/link/contacts_users`. How exactly can we access this relationship via the API?

Context: we are using SugarCRM as an API for a custom frontend, and we would like to leverage the many-to-many relationship between contacts and users to set up restricted visibility for assigned users. I'm aware that SugarCRM has a default assigned_user field, but we need to assign more than one user to contacts. 

Parents Reply
  • This won't work for us since we don't want the rigidity of teams. This will be similar to, say, Google Docs, where you can add or remove users on an individual level for each doc.

    I may just create an additional many-to-many relationship to handle this.

Children
  • The link name is user_sync (see modules/Contacts/vardefs.php), so 'Contacts/:id/link/user_sync' would return a contact's users. Coming from users, the link name is contacts_sync (see modules/Users/vardefs.php).
    But the contacts_users relationship is used for contact syncing with the MS Outlook Plug-in.

    As Jeff said, Teams and Team-Based Permissions should do what you want. Remember that for every user in Sugar, a corresponding private team is automatically created. So you can add or remove access for individual users by adding/removing their private teams.