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).
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | cck_edit_all_contenttype.patch | 963 bytes | RayZ |
Comments
Comment #1
RayZ commentedHere is a patch (untested) that should be equivalent.
Comment #2
drummTested and it seems to work.
Comment #3
drummThis is a feature in configurable content types in Drupal HEAD, so I think it needs to be added to CCK for 4.7.x.
Comment #4
drewish commentedhttp://drupal.org/node/80786 was marked as a dupe of this
Comment #5
drewish commentedthis patch is working for me.
Comment #6
karens commentedI added 'edit $name content' permission instead of 'edit all $name content', to match permissions used in 5.0 core
Comment #7
(not verified) commented