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

[Discussion] Implementing organisation-specific permisisions #133

Open dc2007git opened 1 week ago

dc2007git commented 1 week ago

[ discussion with @anchit-chandran ]

image

We are going to implement organisation-specific permissions into npda. It probably can't be done with a PermissionRequiredMixin because these apply to a whole view - whereas we want to add an extra layer of permissions for those who CAN access the view. Something like this:

  1. Can the user access the view? (use PermissionRequiredMixin)
  2. Can the user access the organisation/PDU data?

What we were thinking was that for each request that goes out, we cross check the PDU/ODS that is being requested with the PDU/ODS that is assigned to the user (or if they are superuser / rcpch audit team member) and if they match, return the list, else 403.