rcpch / rcpch-audit-engine

Epilepsy12 Audit Platform
https://e12.rcpch.ac.uk/
GNU Affero General Public License v3.0
5 stars 5 forks source link

Viewing locked audit records #893

Closed AmaniKrayemRCPCH closed 3 months ago

AmaniKrayemRCPCH commented 4 months ago

If a user is accidentally assigned to cohort 5, I can't easily go in and edit that Similarly, I can't view 'submitted' records without unsubmitting them.

Is it possible to do the following:

Let me know if there's a better solution.

eatyourpeas commented 4 months ago

This might be hard to implement @AmaniKrayemRCPCH because by re-enabling the row, the users existing permissions would apply: it is of course possible to give them editing permission for one cohort, and view only permission for another, but will take a bit of time. I could potentially give just RCPCH access to o those disabled rows - that would be the quickest fix to this. This way, all cohorts would be viewable and editable to RCPCH only - could that work?

AmaniKrayemRCPCH commented 4 months ago

agreed that it would be easier to give RCPCH staff edit access - as long as we're able to change the FPA date of a patient in cohort 5, or to delete them.

eatyourpeas commented 3 months ago

Just to add, this vulnerability should be historical. As per this code snippet below - the first paediatric assessment date minimum value now is set at the currently submitting cohort (currently 6), but earlier (date of birth) for RCPCH audit team

if request.user.is_superuser or request.user.is_rcpch_audit_team_member:
        earliest_allowable_date = case.date_of_birth
    else:
        # registering a new child in the audit by a clinical team
        # sets the minimum allowable date to the currently submitting cohort start date
        earliest_allowable_date = cohorts_and_dates(
            first_paediatric_assessment_date=date.today()
        )["submitting_cohort_start_date"]