Together
Together copied to clipboard
Feature/issue #441
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)
- [X] 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
- [X] Is this related to a specific issue? If so, please specify: Issue #441
Checklist:
- [X] This PR is up to date with the main branch, and merge conflicts have been resolved
- [X] I have executed
npm run test
and all tests have passed successfully or I have included details within my PR on the failure. - [X] I have executed
npm run lint
and resolved any outstanding errors. Most issues can be solved by executingnpm run format
- [X] My code follows the style guidelines of this project
- [X] I have performed a self-review of my own code
- [X] I have commented my code, particularly in hard-to-understand areas
- [X] My changes generate no new warnings
Re Done to have a role field instead of admin field.