I would like to grant permissions (edit node permissions) to roles, for editing all nodes that have a CCK field that contains the role name.

For instance role "Chicago" should be able to edit all nodes that have a CCK field that contains the role name.

I've did lots of research on this and I feel that Permissions API is coming close to the solution I'm looking for. The problem is that my php knowledge doesn't reach to program this myself; I have a moderate knowledge of php which is not enough in this case.

How would such a code look like? Any suggestions are welcome

Many thanks

Comments

ebeyrent’s picture

Permissions API won't be able to help with this, I'm afraid. Roles and permissions are global, and what you need is access control on a node-by-node basis. This project may be of some help:

http://drupal.org/project/node_privacy_byrole

You will need to implement hook_node() in a custom module on the insert/update operation to create the node access entry based on the value of your cck field.

gotcha41’s picture

Thank you very much for your reply, I just implemented a solution that uses Taxonomy Access Control. This module doesn't require permissions to be set per node, as it sets permission based on the tag(s) a node has. (I replaced a cck field with a cck taxonomy field , which is basically a cck field that can pick tags from a taxonomy vocabulary ) Permissions are set by role, based on taxonomy tags a node has.

thank you very much for sharing your insight!

ebeyrent’s picture

Status: Active » Closed (works as designed)
ebeyrent’s picture

Issue summary: View changes

more info