cds-snc / notification-planning-core

Project planning for GC Notify Core Team
0 stars 0 forks source link

Command to set platform_admin status #389

Open sastels opened 1 month ago

sastels commented 1 month ago

Description

As a platform admin, I need to be able to make others platform admins without manually editing the database.

WHY are we building?

Currently the only way to make someone a platform admin is to open a writeable connection to the database and manually edit the record for that user. This is dangerous.

WHAT are we building?

A flask command to toggle the platform admin flag for a given user.

VALUE created by our solution

Improved security and reliability: We no longer have to manually edit the database to do this fairly common task.

Acceptance Criteria

QA Steps

sastels commented 1 month ago

I had originally changed admin to add a toggle to the user's information page in the platform admin view, but decided that this opened us to a potential escalation of privileges attack if endpoints were not sufficiently secure. So I then decided that it would be better as a flask command that could only be run from within the k8s cluster (or, at least, something connected to the database).

sastels commented 1 month ago

~WIP~ PR https://github.com/cds-snc/notification-api/pull/2225

P0NDER0SA commented 1 month ago

Pond will attempt to QA this today

P0NDER0SA commented 1 month ago

100% working as expected!