Using the Group module to administrator content editor access control in Drupal 8

A new major version of Drupal core not only means contributed module developers are hard at work upgrading their modules to the new version, but it also gives us the opportunity to think about existing solutions and re-imagining them using all the new advancements Drupal 8. The [Group](https://www.drupal.org/project/group) module isn't a new module for Drupal 8, but with the [Organic Groups](https://www.drupal.org/project/og) upgrade not having any traction at the moment, it is getting some (worthy) attention. The lead maintainer of the Group module, Kristiaan Van Den Eynde ([kristiaanvandeneynde](https://www.drupal.org/u/kristiaanvandeneynde)), has re-written the module for Drupal 8 in order to take advantage of all the improvements Drupal 8 has to offer. His company, [Deeson](https://www.deeson.co.uk) sponsors development of the module (thank you!)

This screencast demonstrates how to use the Group module to configure a site so that different sets of people have permission to administer content only in specific areas (groups). Consider the case where a large library with multiple physical locations has a site where staff from each branch can only administer (add/edit/delete) content in their section of the site.

Library branch locations diagram

In order to fully comprehend the Group module, it is important to note the following:

* "Group type" is a fieldable entity (user-defined groups are not nodes).
* "Group membership" (for users) is a per-"Group type" fieldable entity (implemented via a Plugin). Therefore, each "Group type" can have different fields describing the user memberships.
* The "Group node" module (part of the main "Group" project) provides per-"Group type" fieldable entities for each content type on the site (also implemented via a Plugin). Therefore, each "Group type" can have different fields describing the relationship between nodes of a given content type and a group.

Group module entity diagram

With both "Group membership" and "Group node" entities being fieldable and providing the relationship between a group and a user and node (respectively), they are similar in concept to the Drupal 7 [Relation](https://www.drupal.org/project/relation) module.

## The future of the Group module

While there is [still a bit of work to do](https://www.drupal.org/node/2693167) for the 1.0 release, once that is available, Kris indicates that writing migration support from Drupal 7 Group and Organic Groups to the Drupal 8 Group module will be a focus.

##Resources

* [Group module](https://www.drupal.org/project/group)
* [Group - an alternative to Organic Groups](https://www.deeson.co.uk/labs/group-alternative-organic-groups) - blog post by Kristiaan Van den Eynde.
* [Group for D8: managing groups has never been more awesome](http://drupalcamp.london/content/group-d8-managing-groups-has-never-bee…) - DrupalCamp London session slides by Kristiaan Van den Eynde.
* [9 reasons Group for Drupal 8 is awesome](https://www.deeson.co.uk/labs/9-reasons-group-drupal-8-awesome) - blog post by Kristiaan Van den Eynde.

Comments

Thanks for this great use case and deep explanation of the Group module for D8. I still have to wrap my head around my particular needs, but this was extremely helpful.

Submitted by Steve Fisher (not verified) on Fri, 04/22/2016 - 14:24