Skip to content

Added Super User Functionality#1765

Merged
trillium merged 4 commits intohackforla:developmentfrom
ntrehan:1747
Oct 17, 2024
Merged

Added Super User Functionality#1765
trillium merged 4 commits intohackforla:developmentfrom
ntrehan:1747

Conversation

@ntrehan
Copy link
Member

@ntrehan ntrehan commented Sep 28, 2024

Fixes #1747

What changes did you make and why did you make them ?

  • Disabled the ability to edit anything of the super user in the super user page
  • Added a new access level "superadmin" in the User Model
  • Some CSS changes to reflect that the buttons are disabled for a superadmin
  • Corrections from previous PR, "VRSM Admin" changed to "VRMS Admin" and the whole row is in one line
  • Please note that I promoted "mamoleo@gmail.com" to superadmin in vrms-test just for testing purposes

Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)

Visuals before changes are applied

image

Visuals after changes are applied

image

Copy link
Member

@trillium trillium left a comment

Choose a reason for hiding this comment

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

This looks good, thanks for putting in the work to switch this around.

const [isActive, setIsActive] = useState(userToEdit.isActive);
const [isAdmin, setIsAdmin] = useState(userToEdit.accessLevel === "admin");

// Function to check if the current user is the super admin
Copy link
Member

Choose a reason for hiding this comment

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

Semantics, but this comment says you provided a function but you've provided a boolean

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch trillium! I changed approach mid way but forgot to change the comment. Addressing it right away

@trillium
Copy link
Member

trillium commented Oct 15, 2024

I approved the pull request, but can you please change the word function to boolean in the comment you provided

@trillium trillium merged commit d1a2b0d into hackforla:development Oct 17, 2024
@trillium
Copy link
Member

Merged!

@JackHaeg JackHaeg mentioned this pull request Oct 22, 2024
4 tasks
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.

Implement Super Admin User Feature

2 participants