Assign custom rights to entire cohort

Assign custom rights to entire cohort

by Daan Blokker -
Number of replies: 1

Hi all,

In our moodle environment I would like to give all teachers (about 200 people) viewing rights to all courses, but I can't figure out how to do this.

Our site is arranged like this: site --> category level 1 --> category level 2 --> courses (we have different categories in level 1 and sometimes different categories in level 2)

I have added all teachers to a single cohort in order to add them more easily.

I have created a custom role, applicable for all the different contexts (site, category, course) for guest access, with the correct rights to view all courses. I have confirmed that this role should work as intended.

Ideally I would like to give the cohort with all the teachers the custom role within the category level 1 context, since that would give them access to all the necessary courses without the need to manually add the cohort to each course (we have about 100 courses, so that removes quite a bit of work). I can't find a way to do this though. If I try this through 'assign roles' in the category I have to add users manually, and can't select a cohort. If I try this through site management --> users --> rights -- > assign user roles to site group, I also have to manually select all the desired users.

Is there a way for me to organize this? And I hope my explanation is clear smile

Average of ratings: -
In reply to Daan Blokker

Assign custom rights to entire cohort

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

How about creating a role with no permissions and instead overriding the moodle/course:view capability in the category or course contexts where all teachers should be able to access? Then you can assign that role to all teachers in the system context or you could use some extra plugin that assigns role in system context to all cohort members.

Average of ratings: Useful (2)