Woocommerce-ios: Plugins: Hide feature for non admin roles

Created on 25 May 2021  路  1Comment  路  Source: woocommerce/woocommerce-ios

The plugin list endpoint wp/v2/plugins is only accessible for admin users.
To release the feature we need to hide its accessibility from the setting screen for non-admin roles.

Tasks:

  • [ ] Corroborate that we can access the user's role.
  • [ ] If the role is admin show the "plugin" section in the settings screen.
  • [ ] Refactor code to move the plugin list synchronization out of the session manager, as we don't need to sync it at startup anymore.
  • [ ] Remove feature flag.
app settings feature-flagged task

Most helpful comment

I'd like to submit some ideas early to be possible testing scenarios for later. Whether this goes into a testing guide or just guides how the feature is tested on PRs and in beta, here are some testing scenarios we can consider:

  • Appropriate error appears when there is no network connection.
  • Appropriate error appears when Jetpack is installed but is not activated (i.e. Jetpack was deactivated).
  • Appropriate error appears when Jetpack is not installed (i.e. Jetpack was deleted).
  • Plugins should appear for the following roles:

    • Super Admin on any multisite setup with WooCommerce and Jetpack installed and activated.

    • Administrator on any single site setup with WooCommerce and Jetpack installed and activated.

  • Plugins should not appear for the following roles:

    • Shop Manager

    • Editor or below (i.e. logged in with a higher role and then the role was changed).

  • If I deactivate a plugin on the web and then open the Plugins screens in the app, all plugin statuses should be synced and should be correct.
  • If I deactivate a plugin on the web while the Plugins screen is open in the app, all plugin statuses should be updated at some interval.
  • Everything should work the same when testing from WordPress.com (Atomic) vs WordPress.org (Jetpack) sites.

Note: if any of these testing ideas are not needed or won't be covered, just add a note in the comments with an explanation because it's always possible I've made assumptions that are incorrect. Thank you!

>All comments

I'd like to submit some ideas early to be possible testing scenarios for later. Whether this goes into a testing guide or just guides how the feature is tested on PRs and in beta, here are some testing scenarios we can consider:

  • Appropriate error appears when there is no network connection.
  • Appropriate error appears when Jetpack is installed but is not activated (i.e. Jetpack was deactivated).
  • Appropriate error appears when Jetpack is not installed (i.e. Jetpack was deleted).
  • Plugins should appear for the following roles:

    • Super Admin on any multisite setup with WooCommerce and Jetpack installed and activated.

    • Administrator on any single site setup with WooCommerce and Jetpack installed and activated.

  • Plugins should not appear for the following roles:

    • Shop Manager

    • Editor or below (i.e. logged in with a higher role and then the role was changed).

  • If I deactivate a plugin on the web and then open the Plugins screens in the app, all plugin statuses should be synced and should be correct.
  • If I deactivate a plugin on the web while the Plugins screen is open in the app, all plugin statuses should be updated at some interval.
  • Everything should work the same when testing from WordPress.com (Atomic) vs WordPress.org (Jetpack) sites.

Note: if any of these testing ideas are not needed or won't be covered, just add a note in the comments with an explanation because it's always possible I've made assumptions that are incorrect. Thank you!

Was this page helpful?
0 / 5 - 0 ratings