-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ability to remove admins ❌ #408
Conversation
@wflore19 I know that the issue was stale, but please still comment on any issues that you'd like to take so other people know who's assigned to what 🙏 |
@ramiAbdou heard, i think there's a potential issue with this pr, when removed from admins list i'm still logged in |
@wflore19 is this still a WIP or ready for review? If you're still working on it, let's switch this to a draft PR! |
@tomas-salgado sounds good, I might need help with this one, how does authentication work for admins? Auth needs to be revoked when an admin is removed. Also can any admin remove another admin? What is the difference between temp admins vs FT admin? |
Great question - we actually need to slightly rework our authentication/authorization mechanism in the Admin Dashboard. Will push an update and follow up a bit later today! |
Hey @wflore19 - following up here, I was able to merge #426 yesterday which revamped some of the authentication logic in the Admin Dashboard. Here's what you need to know:
Also, just noting that I consolidated some of the admins module (we're going to less splitting up of files going forward and more colocating of related logic), so Let me know if you have any questions at all! Also apologies on the merge conflicts! 😭 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Tested out the functionality and it all works correctly.
The only thing I wonder is if we should implement the functionality so that you can't remove yourself as an admin 😆. I don't think there would ever be a reason to do this, and it would most likely just be a mistake.
@tomas-salgado sounds good i'll make the change |
NotesIn order to conditionally render the
|
Update1
3 |
@wflore19 the So in this case, if we wanted to omit the dropdown for certain rows, we can just |
@ramiAbdou That makes sense, if the current users id EQUALS the id given from row data, return null. How should I handle passing the current users 'id' to the '<Dropdown >', w/ useContext or prop drilling? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work @wflore19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @wflore19 -- just tested this out and it looks really great! 🔥
Really appreciate you asking questions throughout this PR, it inspired an important change around the way that we handle auth, which is really great for us. Thanks for sticking through this PR even despite some of the uncertainty!
I made a few updates here that revolve around whether or not the admin has permission to remove another admin. Check it out and let me know if you want to talk through some of those changes.
Another Wilfredo PR in the books! 🚀
Description ✏️
Closes #250
AdminDropdown
with the option to remove an admin to theAdminsTable
component.removeAdmin()
function to update an adminsdeletedAt
column.Type of Change 🐞
Checklist ✅