How to limit access to content to only users with the same role as the content author?
Option 1 - Group module

You could, for sure, use the Group module for this. Group 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. The Group module creates groups as entities, making them fully fieldable, extensible and exportable.

For more details about the various roles and permissions, refer to my answer to "What are the various roles supported by the Group module?".

Resources


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".


Option 2 - Possible alternatives

Refer to my answer to "Recommended modules for managing Content access?" for some other modules that you might want to consider as a possible alternative. Even though it's not part of your question (today), I don't think any of them have a D8 version already.