woocommerce / woocommerce-paypal-payments

https://wordpress.org/plugins/woocommerce-paypal-payments/
GNU General Public License v2.0
61 stars 47 forks source link

Admin notice displayed for non-admin users #2378

Open cssjoe opened 1 week ago

cssjoe commented 1 week ago

Describe the Bug

If I install the woocommerce-paypal-payments plugin, activate it, and log in as a non-administrator, I see an admin notice on all wp-admin pages -- "PayPal Payments is almost ready. To get started, connect your account with the Activate PayPal button on the Account Setup page.". I can click the link and I see an error "Sorry, you are not allowed to access this page.". I expect not to see the admin notice unless logged in as an administrator.

To Reproduce

  1. Install the woocommerce-paypal-payments plugin
  2. activate it
  3. log into wp-admin as a non-administrator
  4. See admin notice
  5. Click the link in the notice
  6. See the error

Expected Behavior

I expect not to see the admin notice unless logged in as an administrator.

Actual Behavior

I see the admin notice, click the link, and see an error.

Environment