0

I'm still getting used to the way Drupal works, most of what I have read on adding User Level Security on a Drupal site seems to be either View based or by using a Module like Panels. I am creating a site that is rather simple in structure, with some high level pages that differentiate out the content to different areas. I am using Superfish to generate a drop down menu system at the high level, and underneath I have some content areas that will either contain only a few pages or one specific area that will have many. I am also using shortened URLs to make site structure easier to manage, although in general it comes across as flat. I may be wrong in thinking in terms of pages, and if I need to reconsider that for the site that's ok, I have only been using Drupal for the past 6 months but its a good fit as a CMS for the site I am working on.

The requirement is only for three types of Users - Admin, Group Leaders, and Members. I'd like to give Group Leaders some access to pages for editing permissions, although mostly only at a second level or specific pages. Members will have some editing rights but only on a few pages. Group Leaders and Members will have access to content in one specific area, where I will have many pages, no one else should be able to get in. Content pages on Member activities will be accessible by only those who have a login, those not logged in should ideally not see the links or not be able to access the pages.

With Drupal 7, and using the Bartik theme and some modules (Chaos Tools, Display Suite and Superfish for now) what is the best mechanism to be able to grant permissions to view and access content on only specific pages in the structure I have? The site is still new, so if I have to make changes I'd like to do so now before it gets too complex.

Update: Just to note in addition what happened. I was looking for some sort of access that was simple to add in and allow me control on an individual node. Content Access module gave me this in a way I can teach my Users to utilize. Sorry if it seems a duplicate, I was looking for more of a description on what the modules did than I had seen before.

0

3 Answers 3

1

You can try the organic groups module, it provides all the functionalities that you are looking for:

  • Organic Groups (OG) enables users with permissions to create and manage their own groups.
  • Content of the "Group Content Type" has the unique ability to belong to multiple Groups at once. This reduces duplication and increases content accessibility.
  • Utilizing users to adopt content allows users to create their own libraries of content without having to create duplication.
  • Content is thus associated with the user and can be maintained by the user, and group maintainers can then manage content in ways that help their audience.

Few references for the organic groups:
Module docs: https://drupal.org/node/1114858 , https://drupal.org/node/1603460

http://vimeo.com/32398425
http://vimeo.com/32398425
https://drupal.org/node/2014929
https://drupal.org/node/2014793


However if you are looking for some simpler method than you can try the following modules:

  1. Content access module: It 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.

  2. Node access module:It is a Drupal access control module which provides view, edit and delete access to nodes. Users with the 'grant node permissions' permission will have a grant tab on node pages which allows them to grant access to that node by user or role. Administrators can set default access controls per content type, and also define which roles are available to grant permissions to on the node grants tab.

4
  • You can also check drupal.stackexchange.com/questions/87691/… Oct 4, 2013 at 10:51
  • I saw the Content Access module but it looked to still be in Beta for Drupal 7, I like the OG module but that may be too sophisticated for my Users. Some interesting options though.
    – MichaelF
    Oct 4, 2013 at 12:58
  • Content Access module was the one I went with since it gave me the simplest mechanism and the easiest access control per page which is what I was looking for. Thanks.
    – MichaelF
    Oct 6, 2013 at 11:25
  • @MichaelF Great, Definitely content access module will provide you the required functionality. Oct 6, 2013 at 11:38
2

Well when you say page in drupal, it comes down to a lot of options. it might be a views page, a panels page, a page created directly with hook_menu().

So options:

  1. If its a panels/views page, you already have permissions options there through UI in those cases.
  2. Node and taxonomy term pages, have contrib modules that does this..Ankit's answer above lists out some.
  3. If the page is a custom page defined bu hook_menu, you can employ '#access_callback' parameter to add a permissions function where you can return TRUE of FALSE based on check.

After restricting access to each page based on roles, these will be respected already when you add their links to the superfish menu.

3
  • Knowing the roles will be respected with Superfish is a bit off my mind, I was worried about that. Thanks!
    – MichaelF
    Oct 4, 2013 at 12:49
  • MichaelF, just to make sure you have got me right, roles will not be respected as such by Drupal menu System/ Superfish. You first need to set permissions (which you can do role specific), by employing any of the method above as i laid out, and once set, those permissions will be respected by menu system/superfish. Hope this clarifies a bit more.
    – Neo
    Oct 4, 2013 at 12:58
  • Understood, one thing I have learned about Drupal is the configuration required for many things.
    – MichaelF
    Oct 4, 2013 at 13:35
0

It looks like choice is between organic groups use or not.

In order to get clear what exactly @MichaelF needs: - Do you have something on mind like subsites not exactly subsites though - Consider with this simple example. A "Sport" site where you need different groups as soccer, cricket and each sport will have related content we can say as events and also related users to it.So with a obvious reason we do not want a user from group cricket to see/edit/create events(will be content in terms of drupal) in soccer group, and also we need permission on granularity of groups let say we only want specific user roles in group cricket to create cricket events but not all users can.May be we need to have specific groups menus as well that means when a user belongs to soccer group logs in to the site user has different navigation menus and when user from group cricket logs in he/she has different. - If you have something on mind as as example mentioned above, with no doubt OG is what you are asking for.

Few modules after og module itself that can be helpful for building something mentioned in example are https://drupal.org/node/206712

but yes if you have different thing in mind as per me using OG will turn out to be overkill in every aspect with no use and @neo has well said about the other side.

2
  • No subsites, these will be page groupings more by content areas, mostly the division will be by interest. Such as Model Trains, Model Planes, Model Cars with pages that refer to methods of building, paint supplies and so on. Site Login is all the same and they can look at each others content, but they will have specific interests. I don't want anything too complex to configure but that's a hard reach with Drupal.
    – MichaelF
    Oct 4, 2013 at 15:21
  • You don't need OG in that case, as a note do not get confuse with "subsite", I used this term to make it easy to see an usecase.
    – arpitr
    Oct 4, 2013 at 15:48

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