Add new endpoint to admins API to retrieve accounts where admin has specifed role/s
Problem:
Given a users user_id or sis_user_id I want to retrieve a list of all the sub-accounts they have admin access to, with a given set of roles. Passing at least one role would be required (at least in this implementation).
Example request/response:
GET /api/v1/admins/<user_id>/accounts?role_ids[]=347&role_ids[]=347
GET /api/v1/admins/sis_user_id:<sis_user_id>/accounts?role_ids[]=347&role_ids[]=347
Returns a list of Accounts
Why does this matter?
The workaround to getting this info out of the Canvas system is a costly operation. Here is how I would have to do it and as far as I know it's the only way:
- Load up all subaccounts under the root account
- For each subaccount load up all the admins
- Then iterating through each admin, find the matches for my sis_user_id and role_ids
This sequence takes a very long time for an instance with as much data as ours.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.