We're currently running 1.9 with a view to going to 2.2 in the summer this year, so i'm not sure if I will still need this when we move, but it'd be useful to know anyway.
I have a block plugin currently that uses get_roles_with_capability to fetch everyone that can view the current course:
get_roles_with_capability('moodle/course:view', CAP_ALLOW, $context);
I'd like to be able add in all the teachers I have that are assigned roles in the category above the course, I have lots of courses that span multiple years and grouped into one subject category, with most staff being assigned at the higher level and students on the individual course.
I've tried things like:
get_roles_with_capability('moodle/category:update', CAP_ALLOW, $context);
but to no avail and unless I am mistaken there is no core leve capability for category/view?
Any help on this would be greatly appreciated, I am only just beginning to dip my feet into the world of Moodle development and it can be quite confusing but these forums always seem very helpful.