Filter user list

Filter user list

by Hung Tran -
Number of replies: 0

Hello,

We have our custom plugin which groups users. Each group has 1 or 2 group leaders. These group leaders are also administrator so they can access user list (Dashboard > Site Administration > Users > Accounts > Browse list of users)

What we want is if a group leader accesses Moodle's user list, he can only see the users in his group.

I have looked for a way to do this. As I've found out, Moodle has "user_filtering" property in session, it is used in user list, please see user/filters/lib.php. I want to modify this property to add an extra SQL query to filter users.

What I need to do now is modifying "user_filtering" before admin/user.php is called, this is where user_filtering is initialized and user list is rendered. However, I can't find any plugin type which can do this.

I really appreciate if you have any suggestions to achieve this.

In the worst case, we will need to hide Moodle's user list from administrators and create our own one.

Average of ratings: -