Assign capabilities for new role in woocommerce

43 Views Asked by At

I am working on woocommerce plugin. In plugin, I created a new role Franchiser. When I install the plugin and go to New User screen it shows me my created role in dropdown.

Now I want to give capabilities for this new role and has access just these screens on admin panel:

- Dashboard
- Woocommerce
    - View Orders List
    - View Order Details
- Products
- Profile

I tried these capabilities but it shows a lot of screens:

'level_9' => true,
'level_8' => true,
'level_7' => true,
'level_6' => true,
'level_5' => true,
'level_4' => true,
'level_3' => true,
'level_2' => true,
'level_1' => true,
'level_0' => true,
'read' => true,
'read_private_posts' => true,
'edit_posts' => true,
'edit_published_posts' => true,
'edit_private_posts' => true,
'edit_others_posts' => true,
'publish_posts' => true,
'delete_posts' => true,
'delete_private_posts' => true,
'delete_published_posts' => true,
'delete_others_posts' => true,
'manage_categories' => true,
'upload_files' => true,

So what kind of capabilities I gave to my new role so user can access only above mentioned screens in admin panel.

Hope you understand my question.

0

There are 0 best solutions below