How to implement an option for users to limit access to nodes/comments to users with the same role while posting it?
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.