When you are working on a standard Drupal installation, you have content and users and the users have a layer of permissions to access all of that content, however sometimes you might want to make some small sections of your site behave like small communities or you may want only certain users to have access or control over a small portion of the content, in those cases this is where the Group module makes sense.
URL to module: https://www.drupal.org/project/group
The group module allows you to create small groups to which you can associate content and users from your site and grant control over the permissions of those groups to view, create or edit content within that group, you can hide or make the group public and manage the members, some usage scenarios could be:
- When you want to segment users into small communities
- Establish specific permissions for those communities
- Create and share content within that community
- A more advanced use is the creation of subsites or even the creation of multisites.
All functionality this module has to offer is based on custom entities, opening the door to various extensions or alterations for the user to see what fits. The relationship between a group and its content or users is also an entity, allowing you to easily add metadata to this relationship.
One of the goals of the Group module is to be user friendly as much as possible by: Setting up scenarios involving:
- Group behavior
- Access permits
- Subgroups
- Among others...
When to use Group
Consider the following use cases for how Group can be useful for your project
- A website for a user base that is divided into a hierarchy such as a school, where a classroom has a teacher and students, but above them there is a faculty etc., groups can be used to divide users according to hierarchy, for example a teacher who has permissions over certain students in a certain classroom which is a group. Another example is the news sections of a newspaper where certain reporters only have access to publish news in the section they are assigned to.
- A platform where content is only visible to a select group of users, even when they share the same role within the site
- Generally when you want to have more granular permission control over certain segments of site content.
When NOT to use Group
- To categorize content, it is better to use taxonomies
- To categorize users, it is better to use fields
- Like other types of nodes, it is better to use content types
Key concepts of Group
- A group is to a type of group as content is to a type of content.
- All groups of the same type follow the same rules
- Groups are unique in their members, contents and data in their fields
- A group does not necessarily have to have members
Rules defined by a group type
- What content can be placed within the group
- Who can do what (Roles and permissions)
- What fields are available (Similar to content types)
Explanation of the permissions layer
- The interface is very similar to the one Drupal uses in global permissions and roles, however this is specifically for Groups
- There are three types of users: Anonymous (i.e., those who do not have an account on the site), those who are authenticated but are not a member of the group (Outsider), and those who are members of the group (Member).
- Some permissions may not be available for some types of users (Example entering group)
- You can define your own roles within the member user type
Important modules that complement the experience of the Group module
- Group Menu
- Group Media
- Group Taxonomy
- Group Domain
- Block visibility group
- Among others.
This is just an introduction to this module which is very useful for very specialized installations.