Is there an interface where the administrator (or a user with proper permissions) can set the user relationships? I've looked for documentation on this but couldn't find much.

Specifically, what i would like to do is have the admin, or just certain users, set the relationships of other users. These other users should not be able to set their own relationships.

Some thing like this is very helpful for situations where users are clients and clients are handled by an outside affiliate and you dont want affiliates to be able to add clients that aren't really theirs.

thank you! great module!

Members fund testing for the Drupal project. Drupal Association Learn more


mtsanford’s picture

This functionality does not exist in the main module or any of the other submodules that hook into it as far as I'm aware.

This is something that would probably be possible to do as a submodule that hooks into the main User Relationships API module.

alex.k’s picture

You are correct. Personally I've been using masquerade to manage other users' relationships, but that may be too powerful of a solution for your case.

akolahi’s picture

Category: support » feature

I curious if others are interested in adding a permission for users to be able to set other users' relationships. This module is so powerful and can be used in so many other applications other than for social networking. By allowing a user role to be able to set other user's relationships (but those users cant set their own relationships) it opens up so many possibilities for this module to be used as an organization management system i.e. clients, managers, employees, team leaders etc.

I would be willing to chip in for such functionality so long as it's contributed back to the drupal community. Thank you.

alex.k’s picture

Version: 6.x-1.0-beta9 » 6.x-1.x-dev

Agree completely with your direction. That is where I want to take UR. Time permitting, will try to work some of these features into the project, hopefully with help from others.

patchak’s picture

Hey there, so my feature request is to allow site admin to set certain relations as "Locked" especially to disallow the requestee to remove the relation with someone that just points to them.

My use case is doing a "follower", "followed" feature. The followed person should not be able to remove the relation to someone that is following them, or at least that should be an option??


MisterSpeed’s picture

Assigned: Unassigned » MisterSpeed
alex.k’s picture

@63reasons let's figure out an approach to make this work. I was thinking of adding controls to set which roles can do what actions with a relationship type. The UI and implementation would be similar to #228206: Different types of relationships per role type. Actions would be:

  1. request a relationship (this is what 228206 does)
  2. which roles can accept a relationship - if user B is not in these roles, they can not accept a relationship. That means that no one can send a relationship request of this type to this user.
  3. which roles can delete a relationship. This would cover request in #5 above.

To address request in #3 we need to think of a good user interface. If folks have ideas, it would be good to hear. Thanks.

MisterSpeed’s picture

Please find the patch files for the allow disallow remove link change. admin can change the setting for this option,

Let me know if this work, or you want some different way.


alex.k’s picture

Status: Active » Needs review
alex.k’s picture

Status: Needs review » Needs work

@63reasons this needs to be configurable per relationship type. Please see implementation of #228206: Different types of relationships per role type, e.g. line 150.

I would also change the table user_relationship_type_roles and add columns for each of the different type of permissions that we're adding. The table was created to support just one permission, so it did not need to denote what exactly an entry means. We would need to add columns can_request, can_accept, can_delete to this table and tie in admin interface as well as checks in the UI to respect these options. Feel free to postpone if you're not yet familiar enough with the code. Thanks looking into it.

MisterSpeed’s picture

Assigned: MisterSpeed » Unassigned
raintonr’s picture

I'm thinking that it might be useful to have relationships controlled only by an admin.

Ie. would want to loose all the links on profiles that request relationships (should be done with a permission), and replace with a section that allowed an admin to create/edit/remove relationships without needing approval.

This would be useful when a HR department user has full control over relationship tree in their organisation for example.

The form would have something like

Current Relationships:
<user link> <relationship type> to current user <checkbox to delete this relationship>
<delete checked button> 

Create Relationship:
<user auto complete input> <relationship type dropdown input>
[ Javascript add lines here would be nice ]
<submit button>

Then, when a department goes from one manager to two for example, and half the staff report to this new manager, the admin can edit the staff members (sadly, one by one) and change the manager relationship to the new manager (user).

akolahi’s picture

I agree that allowing an admin permissions to have control over user relationships should be independent of the permission of whether users can add/create their own relationships.

akolahi’s picture

alex.k, I would be able to provide some monetary help in the development of this - if that would be helpful in expediting it's development.

alex.k’s picture

I have some ideas on how to do this in a reusable fashion... Meanwhile can you summarize all the different use cases (actions) that admin should be able to do, so we have a single place of reference rather than strewn across various comments. That would help make sure that everything is accounted for in design. Thanks.

jtjones23’s picture

Would also love to be able to administer user relationships. I'm setting up a mentor/mentee project for the fall. Each mentor will have 4 mentees and I'd rather assign the relationships rather than have them choose the relationships.

I'm willing to test patches.

Thanks for all the hard work.

akolahi’s picture

I'm thinking:
* each relationship type should have a role-based permission of whether a member of that role can or cannot request that particular relationship type for themselves. There are applications where you don't want members of a certain role to be able to request certain relationships.

* each user relationship type (i.e. manager/workgroup) can have a 'relationship type admin' (role permission based) that allows the type admin to set that particular relationship for other users. Thus someone may be a relationship type admin of one relationship type but not necessary of another type.

*what would be EXTREMELY helpful for my application would be the ability for users of a particular role, to be able to add users and by doing so there is an implied relationship automatically applied. For example affiliates can add their customers (on their behalf) and by doing so there is automatically an affiliate/customer relationship applied. there is a module for users to be able to add other users... i'm not sure how easily that can be integrated.

Bilmar’s picture

quick note that Manuel Garcia has made the first * from #17 at into a patch.
I have tested and it works great! =)

DrupalSza’s picture

"I'm thinking:
* each relationship type should have a role-based permission of whether a member of that role can or cannot request that particular relationship type for themselves. There are applications where you don't want members of a certain role to be able to request certain relationships."

- absolutely - have you had any success with this one? role-based permission as to whether or not a user of type A can request/receive specific relationship?

Bilmar’s picture

Hello, I was wondering if there has been any further development in this area?
#327624: Extend role access to configure "which roles are allowed to receive this relationship" has been brought up to the last dev.


joostvdl’s picture


Todd Zebert’s picture


Hitby’s picture


Hitby’s picture

Re #12 raintonr - has there been any progress made with regards to this functionality - or has anyone found another way to accomplish the same thing?


raintonr’s picture

Re: #24. You could implement user node then put a CCK user ref field on the user nodes and then use field permission to limit who can set these. There is also a CCK field for two way relationships that could complete the set.

mrf’s picture

Status: Needs work » Closed (won't fix)

The whole idea of how relationship permissions are managed is changing for 7.x so the approach would be very different for this type of feature and 6.x is now in maintenance mode with bugfixes only.

Feel free to open a new issue against 7.x if admin relationship editing is still needed with the new permissions available.

kingswoodute’s picture


I'm using User Relationships in D7. How do you set up relationships for other users?

I'd like to be able (as superuser) to define relationships between other users but I'm not sure how to do this.

Great module, thanks very much!