What's the best way to restrict enrollment user list to Institution and Department?

What's the best way to restrict enrollment user list to Institution and Department?

by Alan Hare -
Number of replies: 0

I have a role created called "Student Supervisor" which has the capability of manually enrolling users.

I need to restrict what users this role can see when manually enrolling students into a course, by restricting the list of users shown based on Institution and Department fields matching current User.

Example:

UserA

  • HasCapability = enrol/manual:enrol
  • Profile Field Institution =  91
  • Profile Field Department = 00101

UserB

  • Profile Field Institution =  91
  • Profile Field Department = 00101

UserC

  • Profile Field Institution =  92
  • Profile Field Department = 00101

UserA, when selecting Enrol will only see UserB (and users of like based on Institution and Department fields) and not UserC.

What function controls the manual enrol: user details query?  Can someone provide examples of how the query might look?

Average of ratings: -