-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add a permission for supervisor to edit contacts #750
base: master
Are you sure you want to change the base?
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.
I thought we were going to add an extra permission action to the framework rather than just hardcoding supervisors having permission? Then we would do a can(...)
check on this permission, and if that passes OR one of the existing hardcoded checks passes, then they can edit
@@ -93,7 +93,8 @@ const canPerformActionOnContact = ( | |||
// Transferred tasks need to be edited by an owner that didn't create them. | |||
if ( | |||
contactObj.createdBy === user.workerSid || | |||
contactObj.twilioWorkerId === user.workerSid | |||
contactObj.twilioWorkerId === user.workerSid || | |||
user.roles.map(role => role === 'supervisor') |
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.
user.roles.map(role => role === 'supervisor') | |
Boolean(user.roles.find(role => role === 'supervisor')) |
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 after the tests are fixed
Description
This PR adds a permission check for supervisors to edit in-progress contacts
Checklist
Other Related Issues
None
Verification steps
AFTER YOU MERGE
You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P