NSS-Day-Cohort-69 / tabloid-tabloid-team-2-gonzos

tabloid-tabloid-team-2-gonzos created by GitHub Classroom
0 stars 0 forks source link

Prevent Loss of All Admins #19

Open stevebrownlee opened 5 months ago

stevebrownlee commented 5 months ago

As the Tabloid Product Owner, I would like to ensure at least one User Profile has a User Type of admin at all times, so that someone will always be available to administer the system.

Given only one User Profile has administrative rights
When the user attempts to deactivate that last admain
Then they should see an error message instructing them to make someone else an admin before the User Profile can be deactivated

Given only one User Profile has administrative rights
When the user attempts to change the User Type of the last admin
Then they should see an error message instructing them to make someone else an admin before the User Profile can be changed

Kayce-Bracewell commented 5 months ago

maybe in the endpoint to demote a user, and the endpoint to deactivate a user, add some sort of logic to return an error if they are the last admin?