Skip to content

Role and study-admin privilege changes send no notification to the affected user #930

Description

@iamtanuj18

Three admin-initiated endpoints let a caller change a user's role or study admin privileges but none of them notify the affected user:

  • PATCH /users/{userID}/role (UsersController.updateUserRole) — OperatorAdmin can change any user's role between OperatorAdmin, OrganisationAdmin, StudyAdmin, and Participant
  • POST /users/{userId}/make-study-admin/{studyId} (UsersController.makeStudyAdmin) — grants StudyAdmin over a specific study
  • POST /users/{userId}/remove-study-admin/{studyId} (UsersController.removeStudyAdmin) — removes StudyAdmin from a specific study

Being promoted to OrganisationAdmin (or having admin privileges revoked) is an auth-relevant change the user should be aware of, both for their own visibility and as an audit signal in case the change was made by a compromised admin account.

Related to #928 and #929 which flag the same silent behaviour on password reset and profile edits.

Suggested fix: send a notification email on each of these transitions ("You have been made a StudyAdmin of X" / "Your CTRL admin role has been changed to Y" / "You are no longer a StudyAdmin of X. If this wasn't you, contact support.").

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions