On Drupal 6, how can I let registered users edit their own content and also allow them to edit an already existing admin content (just one content type) and then when saved, the user takes ownership of that node?
1 Answer
You can give the 'Authenticated user' role permission to 'Edit any <content type>
content'. If you configure that content type to create a new revision by default, the user will be registered as the author of that revision (and if you don't give them the 'Administer nodes' permission, they can't uncheck the option to make a new revision). The original author of the node will however still be listed. I can't think of an easy way to change that automatically. But the users can already edit all nodes of that type anyway, so it would only be relevant if you use the node author for some listing or so - in that case, you can probably use Rules to do assign latest revision author as node author.
Edit: OK, so in that case this doesn't help. You can investigate if something along these lines works (I haven't done something like this so I'm not sure it's possible without coding):
- Setup a condition for Rules with Context Rules, something like 'Node author is "admin"'.
- Create a Rules action using Content Access to set 'Per node access control' if that Context condition is triggered.
-
I think its possible to program / alter the authorship of the node upon saving. Either rules or custom code. My only problem now is that with "Edit any <node type> content" , the users can edit other user's content.– r2b2Jan 14, 2012 at 20:05
-
Hm, in that case this doesn't help. Maybe someting like in above edit is possible (not sure if you need to code something to trigger this though).– arjanJan 14, 2012 at 21:33
-
I think I will probably grant the 'Edit any <node type>' permission but I will perform additional checks (via Rule) to see if the user owns the content or an admin generated it. This is also to restrict them from editing other user's content.– r2b2Jan 14, 2012 at 21:47
-
-
1SO i created a rule which checks if the user is visiting the node editing page, and check if he is the owner of the node or if its an admin-authored content. Rules will allow access to the page if the above conditions are met otherwise redirect to the previous page if the node is not his own.– r2b2Jan 15, 2012 at 1:54