Change WordPress user roles and capabilities › Forums › How to or FAQ › Role for Woocommerce that only allows Order Management & FedEx Package Creation
- This topic has 11 replies, 2 voices, and was last updated 7 years, 6 months ago by Vladimir.
-
AuthorPosts
-
12/05/2017 at 19:45 #3701ederingParticipant
I’m trying to create a Role called Order where our fulfillment company can only get to Orders in WooCommmerce and fully manage them (status change, notes, etc). We use a WooCommerce Extension from Xadapter called FedEx WooCommerce Shipping with Print Label. This allows the user to Generate Packages (it shows how many boxes and their weight/size) and then generate a FedEx Shipping Label. When I have all WooCommerce abilities set (which I don’t want), I still get denied to Generate Package in this Role. But as an Admin, I can do it. The only custom capabilities listed in URE are URE and WooCommerce (nothing for this extension).
Also, how do I get a Role to not have access to WooCommerce Settings?
13/05/2017 at 01:36 #3702VladimirKeymasterWooCommerce->Settings is protected by ‘manage_woocommerce’ capability.
1) you can revoke it from a role to exclude this menu item from user access;
or
2) if you need to leave access to other menu items protected by the same capability (System Status, Extensions), you can use Admin menu access add-on to block this menu item.I need access to WooCommerce FedEx plugin in order to check what permissions it requires to print labels. You can send its copy to support [at-sign] role-editor.com
I install such products at local development environment and use for testing/investigation purpose only.13/05/2017 at 11:04 #3706ederingParticipantThanks. But, when I uncheck manage_woocommerce (https://www.screencast.com/t/TzFy0SJp) and try to login to /wp-admin, the login takes me to the WooCommerce My Account page – https://www.screencast.com/t/hmxEFF2S . I just emailed you the zip of the plugin… thanks
13/05/2017 at 11:16 #3707ederingParticipantYour mail rejected my email that had the zip file. So I created a Dropbox.com folder for support email address to access it. Here is the folder: [removed]
13/05/2017 at 13:01 #3709VladimirKeymasterGot a plugin. I will look at it.
13/05/2017 at 13:03 #3710VladimirKeymasterYou can use view_admin_dashboard capability for access to wp-admin with active WooCommerce. Read this article for more details.
13/05/2017 at 13:16 #3711ederingParticipantThanks for the article. But do I click Add Capability for Role in URE and add view_admin_dashboard or do I need to add the function for the Admin Dashboard? Or both?
13/05/2017 at 13:18 #3712VladimirKeymasterAdding new view_admin_dashboard capability is enough. It was added recently. Custom filter is a former method to manage this issue.
13/05/2017 at 13:20 #3713ederingParticipantI figured out the view_admin_dashboard. I just had to add it, no need to change my functions file. thanks
13/05/2017 at 13:39 #3714VladimirKeymasterFedEx shiping plugin allows to use ‘Generate Packages’ feature to users with ‘administrator’ or ‘shop_manager’ role only by default. Good news – the plugin offers a custom filter ‘wf_user_permission_roles’ which you can use to add your own role to this predefined list, like this:
add_filter('wf_user_permission_roles', 'wf_user_permission_roles'); function wf_user_permission_roles($roles) { $roles[] = 'wc-orders-manager'; return $roles; }
13/05/2017 at 13:52 #3715ederingParticipantWhere does the above go? Functions.php? And, I have two different Roles I need access to this (in addition to my Admin): Manager, Orders
13/05/2017 at 13:55 #3716VladimirKeymasterYes, functions.php. You have to use role ID in a code:
add_filter('wf_user_permission_roles', 'wf_user_permission_roles'); function wf_user_permission_roles($roles) { $roles[] = 'manager'; $roles[] = 'orders'; return $roles; }
-
AuthorPosts
- You must be logged in to reply to this topic.