ucsb-cs156-s24 / proj-happycows-s24-4pm-7

https://ucsb-cs156-s24.github.io/proj-happycows-s24-4pm-7/
0 stars 0 forks source link

EPIC: Admin can suspend/restore users #30

Open github-actions[bot] opened 2 months ago

github-actions[bot] commented 2 months ago

User Story

Discussion

We looked into the possibility of removing a user from a specific commons, but this turns out to be super complicated.

We went back to look at the original purpose of the user story, and realized that if we need to remove a user from one commons, it's probably better to just remove them from all of the commons.

And that's easiest to do by just preventing them from logging in (in the first place).

Acceptance Criteria

Suggested Implementation

Issue B1: Add suspended field to Users entity (5 pts)

Simple issue that just adds a boolean field to the Users entity with the initial value false.

Issue B2: Add endpoints that suspend or restore user (10 pts, depends on B1)

Simple issue that just adds an endpoint in the Users controller that is accessible only to Admins.

You can look at organic and gauchoride for the toggle admin endpoints for code that would be similar to this.

Issue B3a: Add gatekeeping for suspended users at login time (10 pts, depends on B2)

See B3b before starting.. this one may not be needed if we can do B3b properly...

Add code to the login routine so that if a user tries to login and they are suspended, they get a message and they are immediately logged out. This one may be tricky; you may need the staff to help you with this one.

Issue B3b: Add code similar to the code in organic and gauchoride that monitors role changes (10 pts, depends on B2) (10 pts, depends on B2)

In organic and gauchoride there is code that checks the status of the user and adjusts their roles based on the latest changes to the database. The role changes are effective immediately. We may be able to do something similar here. This one may be tricky; you may need the staff to help you with this one.

Issue F1: Add button to suspend / restore users to Admin/Users table (10 pts, depends on B2)

Just add the information to the table about whether user is supended or not ,and the button that either says "Suspend" or "Restore". The buttons should work, but the confirmation modal can be saved for a second issue.

Issue F2: Add button to suspend / restore users to Admin/Users table (10 pts, depends on F1)

Add a confirmation modal to the button that suspends or restores a user.

github-actions[bot] commented 2 months ago

Copied from https://github.com/ucsb-cs156/proj-happycows/issues/124