ucsb-cs156-m23 / proj-happycows-m23-10am-4

https://ucsb-cs156-m23.github.io/proj-happycows-m23-10am-4/
0 stars 1 forks source link

Hide user UI #86

Closed publicqi closed 1 year ago

publicqi commented 1 year ago

Needs #85 to be merged first.

Overview

In this PR, the frontend of the hide/unhide users is implemented. See https://ucsb-cs156-m23.github.io/proj-happycows-m23-10am-4/prs/86/storybook/?path=/story/components-users-userstable--three-users

It also has the changes to backend same as #85.

Here's a list of detailed changes for grading:

Screenshots (Optional)

Hide/Unhide user page

image

Admin can hide/unhide users

image

A hidden user cannot do any operation (see backend checks). All endpoints with "ROLE_USER" are disabled.

Feedback Request (Optional)

Future Possibilities (Optional)

Right now, all permission (hidden or not) checks are done at the endpoints. That means whenever a new api is added, the user.isHidden() needs to be checked. I wonder if there's a more elegant way (on top of everything, just like the ROLE_*) to do the checks.

Validation (Optional)

Tests

Linked Issues

Closes #84 Closes #48

publicqi commented 1 year ago

I'll fix the conflict when all other approved PRs get merged into main

publicqi commented 1 year ago

This PR has been replaced by #101