publishpress / PublishPress-Capabilities

PublishPress Capabilities gives you control over all the permissions on your WordPress site.
13 stars 4 forks source link

Missing some WooCommerce Capabilities #23

Closed stevejburge closed 3 years ago

stevejburge commented 4 years ago

We're only surfacing about a dozen WooCommerce permissions, whereas these are showing in the User Role Editor plugin:

Screen Shot 2019-12-27 at 4 32 46 PM
stevejburge commented 4 years ago

Related: https://github.com/publishpress/PublishPress-Capabilities/issues/6

agapetry commented 4 years ago

@stevejburge Capabilities already distinguishes all these as Woo Capabilities:

'assign_product_terms', 'assign_shop_coupon_terms', 'assign_shop_discount_terms', 'assign_shop_order_terms', 'assign_shop_payment_terms', 'create_shop_orders', 'delete_others_products', 'delete_others_shop_coupons', 'delete_others_shop_discounts', 'delete_others_shop_orders', 'delete_others_shop_payments', 'delete_private_products', 'delete_private_shop_coupons', 'delete_private_shop_orders', 'delete_private_shop_discounts', 'delete_private_shop_payments', 'delete_product_terms', 'delete_products', 'delete_published_products', 'delete_published_shop_coupons', 'delete_published_shop_discounts', 'delete_published_shop_orders', 'delete_published_shop_payments', 'delete_shop_coupons', 'delete_shop_coupon_terms', 'delete_shop_discount_terms', 'delete_shop_discounts', 'delete_shop_order_terms', 'delete_shop_orders', 'delete_shop_payments', 'delete_shop_payment_terms', 'edit_others_products', 'edit_others_shop_coupons', 'edit_others_shop_discounts', 'edit_others_shop_orders', 'edit_others_shop_payments', 'edit_private_products', 'edit_private_shop_coupons', 'edit_private_shop_discounts', 'edit_private_shop_orders', 'edit_private_shop_payments', 'edit_product_terms', 'edit_products', 'edit_published_products', 'edit_published_shop_coupons', 'edit_published_shop_discounts', 'edit_published_shop_orders', 'edit_published_shop_payments', 'edit_shop_coupon_terms', 'edit_shop_coupons', 'edit_shop_discounts', 'edit_shop_discount_terms', 'edit_shop_order_terms', 'edit_shop_orders', 'edit_shop_payments', 'edit_shop_payment_terms', 'export_shop_payments', 'export_shop_reports', 'import_shop_discounts', 'import_shop_payments', 'manage_product_terms', 'manage_shop_coupon_terms', 'manage_shop_discounts', 'manage_shop_discount_terms', 'manage_shop_payment_terms', 'manage_shop_order_terms', 'manage_shop_settings', 'manage_woocommerce', 'publish_products', 'publish_shop_coupons', 'publish_shop_discounts', 'publish_shop_orders', 'publish_shop_payments', 'read_private_products', 'read_private_shop_coupons', 'read_private_shop_discounts', 'read_private_shop_payments', 'read_private_shop_orders', 'view_admin_dashboard', 'view_shop_discount_stats', 'view_shop_payment_stats', 'view_shop_reports', 'view_shop_sensitive_data', 'view_woocommerce_reports',

I think the issue is that checkboxes are only displayed if the capability is already assigned to the Administrator role. That's not a Woo-specific issue.

Also keep in mind that capabilities for Woo post types are displayed alongside other post types, not in the "WooCommerce Capabilities" section.

stevejburge commented 4 years ago

@agapetry Thanks. Is this a different problem then?

"checkboxes are only displayed if the capability is already assigned to the Administrator role"

agapetry commented 4 years ago

Actually, it looks like the "only if assigned to Administrator" issue was already resolved for the plugin capabilities sections. I just ran a test where the Administrator role has no Woo capabilities assigned, yet these are displayed when editing another role:

image

image

olatechpro commented 4 years ago

Hi @agapetry , just for clarification. The current task is to add all the missing "WooCommerce Capabilities".

So, i'm lost on two things here:

1.) "I think the issue is that checkboxes are only displayed if the capability is already assigned to the Administrator role. That's not a Woo-specific issue."

Is this part of requirement for this task ?

2.) "Also keep in mind that capabilities for Woo post types are displayed alongside other post types, not in the "WooCommerce Capabilities" section."

On this, currently, the capabilities sections are:

and if i'm to add the missing capabilities, they are supposed to be under "WOOCOMMERCE CAPABILITIES" heading.

So, i'm lost on the message that stated otherwise or maybe you can explain better what you mean by 'are displayed alongside other post types, not in the "WooCommerce Capabilities" section."'

agapetry commented 4 years ago

@olatechpro I think we need to review the current functionality before you proceed with this task. From my brief testing yesterday, it looks like the main issue was already resolved. Don't worry, there are other needs. I'll try to review this on Monday.

olatechpro commented 4 years ago

All right

agapetry commented 3 years ago

It looks like we're already covering these through the combination of post type capabilities and the WooCommerce Capabilities section:

image

image