-
Notifications
You must be signed in to change notification settings - Fork 4
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
Redefine permission logic and Add tests for anonymous field and permissions #49
Redefine permission logic and Add tests for anonymous field and permissions #49
Conversation
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.
The isAnon field doesn't exist anymore. src/api/posts.js and src/controllers/serach.js has that field.
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.
Looks good to me. However, some of our own tests are failing. Let's meet and discuss.
Discussed why our own tests are failing. Not enough time to implement necessary changes that are outside the scope of our original implementation. |
Attempt to resolve: #18 #35 #15
Resolves: #41
Files Changed:
incorporated @J0nathanLai 's code for the anonymous field in src/posts/create.js
defined username display based on user role (admin or not) in src/posts/summary.js
added tests for anonymous field and permissions in test/posts.js
added safety check in src/controllers/search.js
cleaned up unnecessary code and console logs in src/api/posts.js, src/controllers/admin/privileges.js, src/middleware/user.js, and src/upgrades/1.4.4/sound_settings.js
Description:
Inside src/posts/summary.js, if the user is not admin, then the name showing up on anonymous posts would be "anonymous user." The test in test/posts.js checks if this logic plays out by setting up an admin user, a regular user, and an anonymous post posted by another regular user. The test checks if the admin user can see the username on the post while the regular user can only see "Anonymous User."
Justification for test not passing:
The test I wrote did not pass. The logic for the test should be correct, but the additional changes required to pass the test are beyond the scope of the implementation we made.