-
Notifications
You must be signed in to change notification settings - Fork 111
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
vguzman812
wants to merge
7
commits into
Together-100Devs:main
Choose a base branch
from
vguzman812:feature/issue-#441
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/issue #441 #447
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Caleb-Cohen
requested changes
Sep 11, 2023
server/models/User.js
Outdated
@@ -7,6 +7,7 @@ const UserSchema = new mongoose.Schema({ | |||
socials: [{ type: String }], | |||
bio: { type: String }, | |||
needsToBeWelcome: { type: String }, | |||
admin: { type: Number, default: 0 }, |
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.
Some requested changes from #441
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Issue
Checklist:
npm run test
and all tests have passed successfully or I have included details within my PR on the failure.npm run lint
and resolved any outstanding errors. Most issues can be solved by executingnpm run format