Haven't learned how to create a patch yet, apologies in advance...

I would like to allow a certain role to edit all nodes of a certain (CCK) type. On a site where you have a (role defined) group of people working together, f.e. moderating content, this would be very useful. I don't know a way of setting this up without either modifying content.module or allowing the role full access to ALL nodetypes... Hence the suggestion to add this to content.module :-)

I think it is this easy:
1. In content.module, function content_perm(), add:

$perms[] = 'edit all '. $name .' content';

2. In content.module, function content_access(), there is currently a snippet like this:

  if ($op == 'update' || $op == 'delete') {
    if (user_access('edit own '. $type .' content') && ($user->uid == $node->uid)) {
      return TRUE;
    }
  }

...the modified version would look like:

  if ($op == 'update' || $op == 'delete') {
    if (user_access('edit own '. $type .' content') && ($user->uid == $node->uid)) {
      return TRUE;
    }
    if (user_access('edit all '. $type .' content')) {
      return TRUE;
    }
  }

It would also be great to have access control on field level. It seems like there is work in progress though (http://drupal.org/node/78563), in the fieldgroup project (http://drupal.org/project/fieldgroup).

CommentFileSizeAuthor
#1 cck_edit_all_contenttype.patch963 bytesRayZ

Comments

RayZ’s picture

StatusFileSize
new963 bytes

Here is a patch (untested) that should be equivalent.

drumm’s picture

Status: Needs review » Reviewed & tested by the community

Tested and it seems to work.

drumm’s picture

This is a feature in configurable content types in Drupal HEAD, so I think it needs to be added to CCK for 4.7.x.

drewish’s picture

http://drupal.org/node/80786 was marked as a dupe of this

drewish’s picture

this patch is working for me.

karens’s picture

Status: Reviewed & tested by the community » Fixed

I added 'edit $name content' permission instead of 'edit all $name content', to match permissions used in 5.0 core

Anonymous’s picture

Status: Fixed » Closed (fixed)