Self-registered Users with specific OUs

Hello community

i want to change my settings so that users can create there own account, i have done all the settings meaing creating default user role and default organisation unit. but my question is suppose in our organisation hierarchy includes also schools in different district,sector,province just like in dhis2 education, i want that headteachers to create their own accounts and the headteacher should have access to his/her school only so how could set the default organisation unit for this case ?

1 Like

Hi @mugisha_alain

It’s not currently possible for self-registration to select their own OU; however, it’s possible to set a default OU for ALL the self-registrations, would that help?

If it doesn’t need to be real-time and manually set by the headteachers, you could use the API to make this work:

  1. Get the list of users emails addresses
  2. Filter the list to only show the headteachers’ email addresses
  3. Set the specific OU to each user in the list
  4. Export this list to update the user info (assigned OUs)
1 Like