How to add a capability to a context or create a new capability

How to add a capability to a context or create a new capability

by KS Læring -
Number of replies: 2
The Participants list available in Site pages or domain/user/index.php?id=1 seems to only be available to the role Administrator or Manager at the site level.

We have a number of category managers, and it would be helpful if they could view the Participants list, preferably only showing participants in their own category.

How do we add the capability

moodle/site:viewparticipants - able to view participants

or change it to

moodle/category:viewparticipants - able to view participants in a course category

to a Manager at category level?

Does this require the creation of a new capability?
Average of ratings: -
In reply to KS Læring

Re: How to add a capability to a context or create a new capability

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

If I understand what you are wanting to do, you should not have to create anything. Just add the Participants block to the front page of your site, then edit its settings. Change the Page contexts to, Display throughout the entire site.

When a manager is in any of their courses, they will see the participants block and since managers already have permission to view participants, they will see only ones enrolled in that course.