Trying to work out this problem, and think of potential solutions.
When a teacher is assigning roles on their course, they can see a list of all the users on the system and their email addresses. I'm trying to prevent all users from displaying and instead only let them choose from a pool of users registered in their course for role assignments.
This means that users in the teacher and/or course creater role needs to only see users in their participants list, while allowing administrators to see all users when assigning roles.
I am also trying to accomplish this without touching the core moodle code; only using administrative options, roles/capability assignments, etc
Basically, I want to see if there is an easy way to accomplish this rather than developing a separate solution outside of moodle.