User & Permissions improvement plan - July 25 2017
Nick Reid, Josh Zamor, Chongsun Ahn
We met to address the current state of loading a user, getting the user's permissions, all the users programs, facilities, etc.
We found that overall we have a lot of overlap in the current endpoints.
Current plan:
Order | Work | Ticket |
|---|---|---|
1 | User's permission strings is under development in sprint 31, we want to schedule work in sprint 32 to use these in the UI | |
2 | make a new users/{id}/facilities resource - it will include home and supervised facilities, current endpoint users/id/supervisedFacilties is to be phased out | |
3 | change /user/{id}/programs to be home and supervised programs (we'll keep the exisiting forHomeFacility query param, and not change representation) | |
4 | start using permissions strings in UI (see #1)
|
|
After the above occurs we'd like to try to improve the /api/users resources performance by removing:
break /users/{id} to only include home facility id
remove role assignments from /users. Move managing the role assignments for a user to a new resource or sub-resource.
might be difficult to do with JPA
will require clients to have migrated to the aforemention strategy
will require changes in the administrator screen to edit a user and his or her role assignments
As of today, I wanted to provide some reference numbers for what we have when logging into test.openlmis.org with demo data as of July 26, 2017 as administrator.
#'s are anecdotal or expected. Sizes are after compression.
call
size
ms
1 call to get the users role assignments (full objects)
2.67KB
1016
1 call to get the user (with home facility object and role assignment objects)
1.28KB
1013
2 calls to get the users programs
0.44KB
2050
4 calls to get user's supervised facilities
4.8KB
5400
Total: 9KB, 9479ms
To be replaced with:
call
size
ms
1 call to get permission strings
1.11KB
500ms (exp)
1 call to get user
TBD (0.25KB)
TBD (100ms?)
1 call to get users programs
0.220KB
250ms (exp)
1 call to get users facilities
1KB (exp)
500ms (exp)
Goal: 2.58KB, 1350ms
Secondary goal is that these endpoints are HTTP cacheable, and the UI will only need to do them once.