The Group module allows for creating arbitrary collections of your content and users on your site, and grant access control permissions on those collections. It is available as of D7, and has a D8 version also. It creates groups as entities, making them fully fieldable, extensible and exportable.
- Refer to What are the various roles supported by the Group module? for more details about the supported roles.
- Refer to the answer to "How to configure access to courses for teachers and students?" for a sample configuration.
- Community documentation for the Group module.
- Video tutorial "How to use the Group module in Drupal 8 to manage editorial access control to different areas of a web site".
- How to create collections of content that can be accessed by users with various access levels?.
- Other questions tagged with the group tag.