Grant access to non Admin user
-
Hi,
It is possible to grant access to run a predefined export from order list page (bulk actions) to non admin users? I would like to grant this access to a shop_manager user. Thanks,
-
Hello
I’ve tested using role “Shop manager” and I see action “Export as XLS” in bulk actions.
if you created new profile at tab Profiles – you must activate it.
thanks, AlexAhh sorry for misleading.
I wrote it wrong. I use a custom Role. It was months ago, I didn’t remember. Sorry for that.
So I created a custom Role to my warehouse manager to be able to access only limited functions. Can you tell me what capability is needed to run bulk export? Bulk export option appears to him, but if he click on that he gets a “You can not do it” message.
The URL is: wp-admin/admin-ajax.php?action=order_exporter&method=export_download_bulk_file&export_bulk_profile=now&ids=…Thank you,
please, edit this role and add permission “view_woocommerce_reports”.
for example, using https://ww.wp.xz.cn/plugins/user-role-editor/
It doesn’t seem to work to me. Maybe something is missing from my list of capabilities. Could you please review my cap. list?
add_role( 'warehouse_manager', __( 'Raktár menedzser' ), array( 'read' => true, 'edit_posts' => true, 'manage_woocommerce' => false, 'view_woocommerce_reports' => true, // for Advaced exports plugin 'edit_product' => true, 'read_product' => true, 'delete_product' => false, 'edit_products' => true, 'edit_others_products' => true, 'publish_products' => false, 'read_private_products' => true, 'delete_products' => false, 'delete_private_products' => false, 'delete_published_products' => false, 'delete_others_products' => false, 'edit_private_products' => true, 'edit_published_products' => true, 'edit_shop_order' => true, 'read_shop_order' => true, 'delete_shop_order' => false, 'edit_shop_orders' => true, 'edit_others_shop_orders' => true, 'publish_shop_orders' => false, 'read_private_shop_orders' => true, 'delete_shop_orders' => false, 'delete_private_shop_orders' => false, 'delete_published_shop_orders' => false, 'delete_others_shop_orders' => false, 'edit_private_shop_orders' => true, 'edit_published_shop_orders' => true, ) );it won’t work, as you must call remove_role() if you want to modify existing role.
more https://developer.ww.wp.xz.cn/reference/functions/add_role/#comment-946
Now it works!
Thank you for your support! 😉you’re welcome
The topic ‘Grant access to non Admin user’ is closed to new replies.