rcpch / national-paediatric-diabetes-audit

A django application to audit the care of children and young people with diabetes in England and Wales.
0 stars 1 forks source link

RCPCH and superuser national access #86

Closed eatyourpeas closed 3 months ago

eatyourpeas commented 4 months ago

Currently the PDU relating to the user is stored in session and used to scope which users and patients are seen down to the PDU.

Superusers and RCPCH team members need to be able to change the PDU/organisation in the session. One suggestion here is for some HTMX and a custom threeway button component with a select, as in E12. The idea would be that a user with national access can view individual organisations within a PDU, the whole PDU as an entity, or nationally (ie all patients/users). This means:

  1. a new threeway button and select as a partial
  2. new htmx post urls to fire on click, with a custom function in the header out of band to refresh the table.
  3. logic in the views POST methods to update the session and return the updated partial to the template.
  4. add permissions to these endpoints to ensure only the right users can access.