Change connection test page capabilities to manage_woocommerce #2443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request:
Part of #2146
Currently, the connection test page is only available to the administrator because it is registered with the
manage_options
capability. However, all our endpoints are checking themanage_woocommerce
capability.google-listings-and-ads/src/API/PermissionsTrait.php
Lines 20 to 22 in cbcff08
This makes it harder for a Shop Manager to debug any issues with the new approach as the connection test page is not available. Therefore, this PR updates the capability to
manage_woocommerce
. Since all actions available on the connection test page are also accessible through the UI for users withmanage_woocommerce
capability I don't think we are giving new privileges to the Shop Manager role.Screenshots:
Detailed test instructions:
add_filter('woocommerce_gla_enable_connection_test','__return_true');
or navigate towp-admin/admin.php?page=connection-test-admin-page
Additional details:
Not sure why but the phpcs were failing for the account services test, so I fixed it in this PR.
Changelog entry