1

One of our websites includes an online store, which alongside phone sales is one of two ways customers can purchase our products. All of our customer info is stored in a program called Orderwise, which assigns a unique number code to each customer. Now, we've set up the ability to add an Orderwise number to user info on the website, so I've been trying to set up a role which will allow the sales department to get through to the dashboard, but only so they can edit user info and add Orderwise numbers manually, and also view WooCommerce info such as orders. So I created a role with the following capabilities via a plugin;

edit_users

list_users

read

read_private_pages

read_private_posts

read_private_products

read_private_shop_coupons

read_private_shop_orders

read_private_shop_webhooks

read_product

read_shop_coupon

read_shop_order

read_shop_webhook

view_woocommerce_reports

I then assigned this role to a dummy test account and tried logging in with that via /wp-admin. This allowed me to login as a public site user, like our customers can, but not to access the dashboard and edit user info.

What capabilities am I missing from my role? Could any of these be conflicting with one another?

0

I cracked it! I went ahead and duplicated an existing role, and trimmed off all of the guff I didn't think my sales role would need. In the end, I ended up with;

 assign_product_terms
 assign_shop_coupon_terms
 assign_shop_order_terms
 assign_shop_webhook_terms
 connections_view_public
 delete_others_products
 delete_others_shop_coupons
 delete_others_shop_orders
 delete_others_shop_webhooks
 delete_private_products
 delete_private_shop_coupons
 delete_private_shop_orders
 delete_private_shop_webhooks
 delete_product
 delete_product_terms
 delete_products
 delete_published_products
 delete_published_shop_coupons
 delete_published_shop_orders
 delete_published_shop_webhooks
 delete_shop_coupon
 delete_shop_coupon_terms
 delete_shop_coupons
 delete_shop_order
 delete_shop_order_terms
 delete_shop_orders
 delete_shop_webhook
 delete_shop_webhook_terms
 delete_shop_webhooks
 edit_others_products
 edit_others_shop_coupons
 edit_others_shop_orders
 edit_others_shop_webhooks
 edit_private_products
 edit_private_shop_coupons
 edit_private_shop_orders
 edit_private_shop_webhooks
 edit_product
 edit_product_terms
 edit_products
 edit_published_products
 edit_published_shop_coupons
 edit_published_shop_orders
 edit_published_shop_webhooks
 edit_shop_coupon
 edit_shop_coupon_terms
 edit_shop_coupons
 edit_shop_order
 edit_shop_order_terms
 edit_shop_orders
 edit_shop_webhook
 edit_shop_webhook_terms
 edit_shop_webhooks
 edit_users
 list_users
 manage_links
 manage_product_terms
 manage_shop_coupon_terms
 manage_shop_order_terms
 manage_shop_webhook_terms
 manage_woocommerce
 publish_products
 publish_shop_coupons
 publish_shop_orders
 publish_shop_webhooks
 read
 read_private_pages
 read_private_posts
 read_private_products
 read_private_shop_coupons
 read_private_shop_orders
 read_private_shop_webhooks
 read_product
 read_shop_coupon
 read_shop_order
 read_shop_webhook
 unfiltered_html
 view_woocommerce_reports

And, as if by magic, this new version of the sales role can now access the dashboard, with access only to the WooCommerce, Products and Users panes.

If anybody is interested, I have been using the inspiringly named User Role Editor plugin to create and edit user roles.

0

Your sales people probably don't need the unfiltered_html capability.

Per https://codex.wordpress.org/Roles_and_Capabilities#unfiltered_html,

Allows user to post HTML markup or even JavaScript code in pages, posts, comments and widgets.

Note: Enabling this option for untrusted users may result in their posting malicious or poorly formatted code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.