1

A site that I'm working on will have lots of users managing the content. Unfortunately their workflow dictates that certain people only have access to certain content types. There isn't a method to their madness, so using roles to do this will result in a nightmare to maintain really fast.

The Content Access module will not work for this. It mentions Authors, but there doesn't seem to be any configuration for this. And managing on a per node basis won't cut it.

I'm thinking the most logical way would be checkboxes on the edit user account page for admins to set. This should limit them to creating and updating content that they have been explicitly allowed to. And the admin menu should only show the content types they were assigned to.

Is there a way to implement this? Or any pointers in the right direction for the appropriate hooks?

  • This should be assigned per role, with users grouped into roles that would allow for sane permissions to be set. See: drupal.org/forum/support/module-development-and-code-questions/… – Kevin Dec 1 '17 at 16:39
  • @Kevin So currently there are 9 content types. So one role per content type and assign each user to those roles? No matter which way I think about going about this, it turns into a mess really quick. But they are pretty adamant about this feature. – John_911 Dec 1 '17 at 16:56
0

It looks like you should give it a try to use the Group module. You'd enable the gnode submodule, and for each group type you would define the appropriate permissions (view, edit, delete, etc) for the various Content Types.

From the details included in your question, it seems that possibly you'd only need 1 group type. And if you then would create 1 group for each of the Content Types involved, you might be close to a working solution.

More info: What's the purpose of the Group module and how to get started with it?

  • Do you have an answer template for this? I was going to suggest the same, but to first assess if they could knock it out with some basic roles. – Kevin Dec 1 '17 at 17:44
  • 1
    It looks like similar format other times you mention Group – Kevin Dec 1 '17 at 19:03
  • @Kevin does my revised answer still look similar? – Pierre.Vriens Dec 1 '17 at 21:22
0

Lots of ways to skin this cat, but in a custom implementation: A hook_form_alter and hook_node_view_alter that calls a custom function that checks the user's privileges before displaying the node page or node edit page. Now the user privilege can be stored in many ways of your choosing, whether it's an actual table you store access in (UID, content_type, access boolean), or a user field that can store information like ['content_type_1'=>true,'content_type_2'=>false'].

0

You can try Node View Permissions

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.