-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
Milestone
Description
I'm noticing the /users (and the /assets) page can take seconds to load if there are many organisation accounts. Internally, the /api/v3_0/users?account_id=<id> endpoint is getting called as many times as there are organisation accounts that the user has access to, so there is great potential to speed this up. Two options that come to mind:
- Allow passing
account_idmultiple times to the users listing endpoint, so we only need to call it once. This would probably require thepermission_required_for_contextdecorator to be enhanced to support a list of accounts. - Alternatively, we stop relying on the internal API so much. For example, instead of
users += get_users_by_account(account.id, include_inactive)(which uses theInternalAPI), useusers += account.usersand then filter out the inactive users if needed.
Arguably, option 2 is easier to implement, but option 1 actually improves API and auth capabilities.