0

I'm playing around with content_access module, and I have a question. For my use-case, I need particular nodes to limit editing by role. This means that the content type will allow role_x to edit by default, but a particular node of that content type will not.

The way it's behaving is inclusive from the top down? If the role has permission on the content type, then they have permission on all nodes of that content type. It's only editable on the individual nodes if they DON'T have that particular permission.

Can someone tell me for sure if that's the proper behavior, or if there's a way around it? And yes, I DO have "Enable per content node access control settings" checked for the content type.

  • We ended up leaving the permission empty on the content type, but adding a rule that checked it on creation of a new node. That way, the permission could be removed from that individual node later if necessary. Felt kind of hacky, but it fit the bill. – UnsettlingTrend Feb 2 '15 at 19:24
1

you can use Content Access Module.

A quick view :

"This module allows you to manage permissions for content types by role and author. It allows you to specifiy custom view, edit and delete permissions for each content type. Optionally you can enable per content access settings, so you can customize the access for each content node."

I hope it works for you

  • This is the module I'm using. From my description though, the way it's behaving is that if roleA has edit permissions on a content type, then you can't remove that permission for roleA on a node of that content type. – UnsettlingTrend Jan 27 '15 at 18:41
  • Weird, because in description says "Optionally you can enable per content access settings, so you can customize the access for each content node." – DarkteK Jan 27 '15 at 19:02
  • That's not technically incorrect, you just can't customize it completely. If roleA has edit permissions on content_type, in the individual node permissions that checkbox will be locked/disabled as checked. You can ADD permissions the further down you go, but you can't take them away. – UnsettlingTrend Jan 27 '15 at 20:19
0

Another way is to implement hook_node_access in a custom module to set the permissions you need programmatically https://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook_node_access/7

if you "need particular nodes to limit editing by role." I also propose to take a look at the workflow module. You can set some states for the node (e.g in review)and only some specific roles can edit the node in that state.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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