Hello,

I would like to restrict users from changing parent when creating new child from link "Create new child ...". I want users to create parent of nodes which only they created.
Automatic parent is assigned but user can change that in form.
Meybe i could just hide field in hook_form_alter? Is it save?

Any ideas?
Thank you.

Comments

davvid’s picture

Title: Enable users to create only children of parents they created » Unable users form create children of parents they didn't create
davvid’s picture

Title: Unable users form create children of parents they didn't create » Prevent users form create children of parents they didn't create
davvid’s picture

I used rules to get around this.
if conditions (php):

global $user;
$parent = node_load( [node:nodehierarchy:parent:nid] );
return $parent->uid != $user->uid;

arent met, I use drupal_goto() to prevent node from being save.

But I would like to use proper, permanent solution.