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

Feature/issue #441 #447

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

vguzman812
Copy link
Contributor

@vguzman812 vguzman812 commented Aug 24, 2023

Description

I have implemented a new property, admin, in the user schema. The property has a type of Number, and a default value of 0. I have also added authentication code to check if the user is an admin. I have added code, which is currently commented out, that only allows the user access to the adminDashboard route if they have an admin property of 1 (I.E. they are an admin). The commented-out authentication code causes failed admin dashboard testing when uncommented due to the mock user not having the admin property. I am unsure if I should flag this PR as requiring an update to testing.

Type of change

Please select everything applicable. Please, do not delete any lines.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change requires an update to testing

Issue

Checklist:

  • This PR is up to date with the main branch, and merge conflicts have been resolved
  • I have executed npm run test and all tests have passed successfully or I have included details within my PR on the failure.
  • I have executed npm run lint and resolved any outstanding errors. Most issues can be solved by executing npm run format
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

@vguzman812 vguzman812 temporarily deployed to DEV August 24, 2023 13:26 — with GitHub Actions Inactive
@@ -7,6 +7,7 @@ const UserSchema = new mongoose.Schema({
socials: [{ type: String }],
bio: { type: String },
needsToBeWelcome: { type: String },
admin: { type: Number, default: 0 },
Copy link
Member

Choose a reason for hiding this comment

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

Some requested changes from #441

@vguzman812 vguzman812 temporarily deployed to DEV September 13, 2023 22:22 — with GitHub Actions Inactive
@vguzman812 vguzman812 temporarily deployed to DEV September 13, 2023 22:23 — with GitHub Actions Inactive
@vguzman812
Copy link
Contributor Author

Re Done to have a role field instead of admin field.

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.

None yet

2 participants