Skip to content
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

Create ability for Admins to promote and demote Admins #1486

Closed
9 tasks
trillium opened this issue Aug 27, 2023 · 1 comment · Fixed by #1750
Closed
9 tasks

Create ability for Admins to promote and demote Admins #1486

trillium opened this issue Aug 27, 2023 · 1 comment · Fixed by #1750
Assignees
Labels
complexity: medium feature: Database p-feature: User Permissions Feature includes how user access levels / user permissions will be implemented in the product p-feature: Users List role: Back End role: Front End size: 3pt Can be done in 13-18 hours

Comments

@trillium
Copy link
Member

trillium commented Aug 27, 2023

Overview

Right now the only avenue to promote a user to admin level is to ping someone with DB access and have them promote the account. Not ideal.

Action Items

The EditUser accessible by an admin needs the ability to promote and demote admins. Here's the short list:

PR Needs

  • Promote a user to an admin
  • Remove a user's admin status
  • Remove self admin status

This will require both front end and back end edits

Front end edits:

  • Create AdminStatus component rendered on the EditUsers page
    • Displays text: "VRMS Admin" and toggle component.
// client/src/components/user-admin/EditUsers.js
<FormGroup>
  <FormControlLabel control={<Switch checked={isActive} />} onClick={() => handleSetIsActive()} />
</FormGroup>
  • Create function within UserApiService:
    • UpdateUserAdminStatus
      This function edits the user's admin status and stores the the user id _id of the admin that promoted them.

Back end edits:

  • update user.model.js to have an adminPromotedBy property of type string
  • apply the update to the user model to across the db

Resources

This task is fairly similar to #1452 , so feel free to use that PR's code as a model for how to do this PR.

@JackHaeg
Copy link
Member

This issue has been updated based on more recent requirements from stakeholder Bonnie, with the request that we drop the requirement to track / block edits to a admin's EditUser page based on who promoted them. Instead, we will implement a super admin user approach via the following issue:

Discussed with Nikhil on September 16, 2024. Minor updates required to this existing issue alone (i.e., changing the button text to "VRMS Admin")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment