Limiting the "Browse list of users" by a hidden filter

Limiting the "Browse list of users" by a hidden filter

by B Meyers -
Number of replies: 3

Is there a way I can limit "Accounts" >> "Browse list of users" to ONLY show users who have a particular value for the "country" field? That is: 

When the manager (who is logged in) goes to see the list of users, only users that match the manger's own country show up in the list.

I know I can do that using the filters. But I would like to hide the filters on this page and automatically show the relevant users (as soon as when the manager visits this page /admin/user.php).

This is mainly to allow a manager to update own users (and not be bothered with other users).

Our Moodle version: 3.2.9

Thank you in advance.

Average of ratings: -
In reply to B Meyers

Limiting the "Browse list of users" by a hidden filter

by John Provasnik -
Picture of Particularly helpful Moodlers Picture of Testers
Consider if Cohorts may help your situation: https://docs.moodle.org/38/en/Cohorts
Also consider - prevent managers from seeing the Browse List of Users from the Site-Level administration block, then enroll users into cohorts based on country, create a course per country and use cohort sync to enroll those users into that course, then the managers can be teachers of those courses and browser their users at the Course Level's participants link.
Average of ratings: Useful (2)
In reply to John Provasnik

Re: Limiting the "Browse list of users" by a hidden filter

by B Meyers -

Thanks very much for the response. 

I think cohorts will be helpful. One item of concern:  

- I am hoping that each Manager in each country can still add new users into their cohort. I don't want a site admin to be the only one creating new users in the system. Could they have that ability to create new users and only assign them to their cohort.

Thank you again.

In reply to B Meyers

Re: Limiting the "Browse list of users" by a hidden filter

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
you might also want to consider if Moodle for Workplace might be suitable for you - Workplace is only available as Sofware-as-a-service from a Moodle Partner but contains some built-in multi-tenancy features and reporting that would probably provide what you are needing out of the box.