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

написао/ла KS Læring -
Број одговора: 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?
У одговору на KS Læring

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

написао/ла AL Rachels -
Слика Core developers Слика Particularly helpful Moodlers Слика Plugin developers Слика 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.