I left this bug to be assigned automatically since I want the maintainer of the roles and capabilities code to take a look at the idea. I'm willing to code this though so assign the bug to me if you approve of the proposed feature addition and I can do it in the next few days.
I want to allow a new optional function in mod/modname/lib.php 'modname_get_relevant_capabilites' that returns an array of capabilities.
This is needed so that activity modules can specify additional capabilities that should appear in the in addition to the ones specifically for this module, that should be displayed in the 'Override Roles' sub tab (override.php) for a module context.
An example of extra capabilities should be overridable in the module context are question capabilities for questions that are shared in the module context. The question code tests the users permissions for what they can do with questions in the context in which the questions are shared.
For background see : http://moodle.org/mod/forum/discuss.php?d=80386