I'd love to be able to grant non-admins the ability to update the "Authored on" feature so they can update the dates on their posts. (We're transitioning to Drupal and some posts that didn't transfer correctly will need to be back-dated).

Is there a way to do this without giving "administer nodes" permissions?

Comments

gpk’s picture

This would probably need you to create a tiny custom module, unless someone has already made it available for download.

Near the bottom here http://api.drupal.org/api/function/node_form/5 you can see

// Node author information for administrators

You need to implement hook_form_alter() to modify the node creation/editing form. The necessary data structure is already present in the form definition, but you need to fiddle with the #access properties so that your users see only the relevant field. Also you will need to implement hook_perm() to create a new permission e.g. 'modify authored on'. Your hook_form_alter() will need to do something like this to $form:

  // Node 'authored on' information for special content creators/administrators

  // Modify the access to this fieldset
  $form['author']['#access'] = user_access('modify authored on') || user_access('administer nodes');

  // Restrict access to the 'name' (Authored by) field
  $form['author']['name']['#access'] = user_access('administer nodes');

gpk
----
www.alexoria.co.uk

janp13’s picture

Is there a way I can remove the author and date, or just the author from my pages?
Jan

gpk’s picture

Have a look here ... http://drupal.org/node/282329 ... you need to implement your own custom theme function to generate the $submitted that gets spat out in node.tpl.php (or you could do it in the template directly, as suggested on that page by cog.rusty).

gpk
----
www.alexoria.co.uk

ngmaloney’s picture

Hi All!

I know this is an old thread but I had a client that needed the same functionality. I couldn't find a module available that allowed granular access to assign create permissions and change author permissions so I went ahead and coded one.

I have a writeup on how it works here: http://prolucid.com/node/79

...and currently have the module hosted here: http://github.com/ngmaloney/modify_authoring_information/tree/master

I hope by now everyone has found a solution but for others searching (like me) you might find my work useful.

Cheers,

NM

laryn’s picture

Thanks for the update -- I'd love to see the drupal 6 port when/if it's ready.