Let's say user X does not have the permission to create nodes of the content type Y, but the user does something which triggers an action, and this action is supposed to create a node of type Y. Will this be possible?

I want to do this because I don't want the user to manually create content as he could mess things up; I'd rather have this automatically done, hence the user not having permissions to create this type of node.

I'm using Drupal 6.


If the code calls node_save() passing to the function a node object that is associated to user Y (i.e., the value of node->uid is the user ID of user Y), the function will save the node without checking if a node of that content type can be created from the user. It is the code that calls node_save() that eventually checks if the user has the permission of creating that content type, or it's the code that shows the link to the form for creating a node of a content type that makes the link visible only to users who has the permission to create nodes of that content type.

node_save() allows you to save a node that is associated to a user who don't have the permission to create a node of the content type Y; the problem is eventually when the user X doesn't have the permission to update nodes of the content type Y, which would not allow the user to update the node that has been created for him.


IF you're looking for a module, I know rules in D7 can absolutely do this. I believe rules in D6 can do this as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.