I have the following setup: I have a content type 'family' which is used via Content Profile as the main user profile page.
I also have another content type 'family_members' with a reference to the 'family' node. (Each family has one account, but I want to include a number of family members with i.e. birthdates, pictures and other info)

BTW, I did the same thing with CCK MultiGroup which worked, but so far CCK 3 is in dev-state and may not really be ported to D7 (any updates on this?) Also UI is somewhat of an issue, since it is a littel bit too complicated for the folks who have to use it.

Setting up all this is rather easy (also thanks to the excellent screencast on galleries by Lulabot)...
...except for two things:

Problem #1: If an admin adds 'family_members' via the Add button in the 'family' node, the user is set to the UID of the admin and not to the UID of the 'family' node. If the admin doesn't remember to set it back to the 'family' user, the real family members cannot edit their own profile pages (relations).
It is rather cumbersome to not forget to set the UID to the correct values and may not even be possible if some account admin is able to add users but cannot set the UID of nodes at all.

Problem #2: I can grant the right to add 'family_member' nodes to all users. However I cannot restrict this to "only the owner of the 'family' node is allowed to add 'family_members'".

If it were only for problem #1, I would be willing to look for a solution using other modules. (I did some research, but haven't come to a solution yet - i.e. the Rules module)
But because of #2 it would be a very cool feature to add, since it "only" requires two things to be added:
* inherit the UID of the referenced node on creation
* display the "Add item" link only, if the user can edit the referenced node type (instead of the node type to be added itself)

Is this possible in 'nodereference_url'?
Is this a desireable feature?
If both answers are "yes", are there any pointers / an outline into the code on how to achieve this – just in case I would try to do so?

CommentFileSizeAuthor
#3 inherit-uid.patch1.48 KBskybow

Comments

quicksketch’s picture

Your #2 problem has been discussed in #833698: Pass on "CREATE" node access .

Your #1 problem I'd say may be out of scope for Node Reference URL Widget, though you could easily enough provide this functionality through a custom module and hook_form_alter().

skybow’s picture

I do agree that #2 should be solved by some node access means, though.

The reason why I'd like to have this functionality in node reference URL is, because of configuration issues: There is a settings pane for the node reference url already. It should be easy to provide one additional items there that handle issue #1.

Do you mind integrating this if I provide a patch?

skybow’s picture

StatusFileSize
new1.48 KB

Ok, here is a patch that adds #1 functionality

It is relatively simple:
It adds a new option to the nodereference url settings.
It also hooks into the code that sets the reference_nid.

skybow’s picture

Status: Active » Needs review
quicksketch’s picture

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

This feature won't be added. I'd suggest using a custom module with hook_form_alter() for this functionality.