-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix: Autocomplete turned off for Staff #314
Conversation
…rop to bounce back uidInput value
… dispatcher logic
…t-no-autocomplete Feature/autocomplete staff list no autocomplete
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/illinois/queue/tecrvxdpig |
} | ||
|
||
// We want to exclude existing staff from the autocompletion list | ||
const filterBy = option => { | ||
return props.existingStaff.findIndex(user => user === option.id) === -1 | ||
return props.existingStaff.findIndex(u => u === option.id) === -1 |
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.
Changed because user
already declared in upper scope.
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.
LGTM, thanks so much for finding and fixing this bug!
Any time! Thanks for accepting the fix :) |
Description: A staff user would attempt to add another staff user and experience a permissions error where an Autocomplete component would attempt to fetch user information that the staff role should not have access to. It rightly resulted in a back-end error being received by the user on the front-end UI.
Fix: Enable autocorrect for the admin user role, but only allow manual entries for the staff user role.
Original issue filed here: #305