Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Talk:Roles

From MoodleDocs

The list of capabilities for some activities should include viewing as a separate capability since it is a distinct action from editing or taking part, for example

choice_canviewresults