Skip to content

Conversation

@longshuicy
Copy link
Member

@longshuicy longshuicy commented Dec 4, 2023

image

This PR:

  1. Add endpoint to revoke admin privilege
  2. Logic to forbid current "admin" user to revoke their own admin access
  3. Admin field was add to the wrong model, fixed that.
  4. Frontend page to manage users, search users, and set/revoke admin access

To test:

  1. Run the scripts/develop/populate_fake_data/populate_fake_data.py. Change number of users if needed
  2. Admin user will have "Manage Users" option at the top bar menu. (Normal user won't)
  3. Try set/revoke admins and watch the page
Pasted Graphic 1 Pasted Graphic

@longshuicy longshuicy requested review from ddey2 and tcnichol December 4, 2023 17:57
@longshuicy longshuicy linked an issue Dec 4, 2023 that may be closed by this pull request
Copy link
Member

@lmarini lmarini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great. I still had to drop datasets and metadata definition to make it work with the admin field. I also added a line to delete-data.sh to drop metadata definition.

Should we move the "Manage Data" link from the personal menu in the top right to the tray menu on the left?

@longshuicy
Copy link
Member Author

Works great. I still had to drop datasets and metadata definition to make it work with the admin field. I also added a line to delete-data.sh to drop metadata definition.

Should we move the "Manage Data" link from the personal menu in the top right to the tray menu on the left?

Ah i see that's what's missing in the drop script.

Do mean the "Manage Users" link? I can certainly do that :-)

@longshuicy
Copy link
Member Author

Works great. I still had to drop datasets and metadata definition to make it work with the admin field. I also added a line to delete-data.sh to drop metadata definition.

Should we move the "Manage Data" link from the personal menu in the top right to the tray menu on the left?

Moved to the side drawer now
image

@tcnichol
Copy link
Contributor

Tested this one and everything looks good. Users cannot revoke their own status.

Copy link
Contributor

@tcnichol tcnichol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this one and everything seems to work fine. Checked that users could not remove own admin status.

@longshuicy longshuicy requested a review from lmarini December 18, 2023 20:55
@longshuicy longshuicy merged commit 08ce55c into main Dec 19, 2023
@longshuicy longshuicy deleted the 842-ui-component-for-assign-admin branch December 19, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI component for assign admin

4 participants