Having a look at the code I see that you can only enrol cohorts defined in a context where your user has moodle/cohort:view capability.
Techers have this capability assigned by default at course level (course context). But you can only define cohorts at the system or category level. So that means that regular course teachers cannot enrol cohorts
Whether this is a bug or a design feature is open to debate . I suspect the reason it works the way it does is because cohort enrolment can be thought of as category (or site-wide) "management". Then it would makes sense to assign that capability at the category or site level to those people in charge of that "management".
But feel free to open a bug if you think the current behaviour is not that useful for most people
The question still remains : how do teachers enrol cohorts (created by admin or manager) ?
Has this been solved? If I make cohorts for our district site - the teachers should be able to enrol them as a group. Is this possible?
Ok - I have been playing with this this afternoon and I would appreciate it if someone would check the theory behind this -are there any major flaws? Is it secure; does it work etc? I will document it if it seems to fit the bill but I just made it up so I don't know
I created a new role for a category (not site wide) called "cohort enroller" and I allowed the following:
I then gave this role in a category to a teacher teaching courses in that category. They are now able to enrol into their courses cohorts that admin made for that particular category.
Hmm... I'm not convinced that the currently policy makes sense. I've commented on this at MDL-23708. Any additions welcome - for or against.
Hi, the issue you have commented in has been marked as fixed.
Is there any other Feature request ticket somewhere ?
We should have teacher able to enrol cohorts, shouldn't we ?
Hi there. No -the issue that was fixed was that teachers had an "enrol cohort" button even though they can't enrol cohorts. That button was removed. They still can't enrol cohorts though.
Has anyone found a way to allow for teachers to enrol cohorts? without giving them system wide access?
My opinion is theat Moodle could solve this problem in 2 possibilities.
1. To be possible to assign a cohot to meny contexts;
2. To add a new permission for example called "Allow system cohorts assign" which allow us to give the theacher permission to assign system cohorts when is necessary.