How to implement an option for users to limit access to nodes/comments to users with the same role while posting it? How can I offer users an option on all node/comment postings to limit access to their own user role group? Essentially making the conversation accessible only for the members of their own year who they are together with in person.

Each year gets its own user role. There are multiple years of group members using the site, and sometimes members would like to limit sensitive content to themselves, as old members retain access to the site otherwise.

Ideally, it would just be a single checkbox that reads 'make this content private to your peer group' without offering any other options, which should restrict the content to their own peer group and to admins.
The short answer is: Yes, you can do this with the Group module.

Here are some instructions on how to do so:


Install the Group module and its dependencies.
Enable the Group Node module as well (a sub-module of Group).
Navigate to admin/group, or click the new Group link in the admin toolbar.
Create a Group Type "Year".
Configure the permissions for that group type to allow members to create and/or view nodes (outsiders will not have access unless checked).


There are numerous things you could add to the mix, such as a "Year admin" group role. But giving a sitewide admin the "Bypass group access" permission will do just fine as well.

You can also delete the group_admin role under Group &gt; Group Roles should you not need it.

If you find any bugs or need support you can also use the Group module's issue queue.

Disclosure: I'm the module maintainer.