CRM: Restrict some contact functions to admins#48358
Conversation
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 1 file.
|
anomiex
left a comment
There was a problem hiding this comment.
Looks like it'll do what it intends. Haven't tested, or tried to verify that what it intends is the right thing.
Linter seems unhappy though.
|
|
||
| // Perms check | ||
| if ( zeroBSCRM_permsCustomers() ) { | ||
| if ( current_user_can( 'admin_zerobs_manage_options' ) ) { |
There was a problem hiding this comment.
As with the other PR, I wonder whether a zeroBSCRM_permsManageOptions function would better match how things seem to be done.
get_userdata() expects an int, but we passed a string (email), which broke the jpcrm_role_check() (which in turn was incorrectly inverted).
664624f to
8beba54
Compare
anomiex
left a comment
There was a problem hiding this comment.
Looks like it'll do what it intends. Haven't tested, or tried to verify that what it intends is the right thing.
Co-authored-by: dognose24 <6869813+dognose24@users.noreply.github.com>
Proposed changes
This restricts some contact functions to admins.
Related product discussion/links
Does this pull request change what data or activity we track or use?
Testing instructions