0

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 1

1

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.
5
  • 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.
    – r2b2
    Jan 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).
    – arjan
    Jan 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.
    – r2b2
    Jan 14, 2012 at 21:47
  • Let us know what you end up using :)
    – arjan
    Jan 14, 2012 at 22:05
  • 1
    SO 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.
    – r2b2
    Jan 15, 2012 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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