title: Woocommerce Custom Role Redirects to Shop Landing Page
body: <p>Hey guys I created a very simple 'order_manager' role that should only be able to view and edit orders. The code is as follows:</p>
  
  <pre><code>// Add a custom Order Manager
  
  add_role(
      'order_manager',
      __( 'Order Manager' ),
      array(
          'read_shop_order'   =&gt; true,  
          'edit_shop_order'   =&gt; true,
      )
  );
  </code></pre>
  
  <p>I can assign this role in the admin panel and this person accepts the invite, but when they go to log in, it redirects them to the landing page for the site (the '/' route)! I'm taking the $capabilities from <a href="https://www.role-editor.com/woocommerce-view-edit-orders/" rel="nofollow noreferrer">https://www.role-editor.com/woocommerce-view-edit-orders/</a> and avoiding using any plugins :) I blew up the picture from that link for "Orders" where they list all the order types, and made my custom user directly from that. I've also done this in incognito mode, deleted the user and re-added them, and logged the user out of any existing sessions via the admin panel.</p>
  
  <p><strong>EDIT</strong> I've confirmed this behavior across two email addresses. A new user and changing roles of a current user. I also added 'read' => 'true' to the role as well. Still getting the 302 to the home page of the shop (not admin panel)</p>
  
  <p><strong>EDIT 2</strong> it looks like these are the wrong $capabilities to give them access to the orders in the admin panel. I was just given them the ability to view their own open orders.... Anyone know the right capabilities to let them look at orders in the admin dash? :)</p>
  
  <p><strong>EDIT 3</strong> I ran the following to pipe user capabilities to the screen for the admin</p>
  
  <pre><code>$data = get_userdata( get_current_user_id() );
  
  if ( is_object( $data) ) {
      $current_user_caps = $data-&gt;allcaps;
  
      // print it to the screen
      echo '&lt;pre&gt;' . print_r( $current_user_caps, true ) . '&lt;/pre&gt;';
  }
  </code></pre>
  
  <p>So this  spat out all Admin roles for woocommerce. My question now is how do you get this data easier? Is there a terminal like place WP can echo out responses? This was super ugly and in my admin page (then update functions.php) and gone again. How can you minimize cycles there?</p>
  
  <p>For the future all admin permissions in woocommerce are:</p>
  
  <pre><code>Array
  (
      [switch_themes] =&gt;; 1
      [edit_themes] =&gt;; 1
      [activate_plugins] =&gt;; 1
      [edit_plugins] =&gt;; 1
      [edit_users] =&gt;; 1
      [edit_files] =&gt;; 1
      [manage_options] =&gt;; 1
      [moderate_comments] =&gt;; 1
      [manage_categories] =&gt;; 1
      [manage_links] =&gt;; 1
      [upload_files] =&gt;; 1
      [import] =&gt;; 1
      [unfiltered_html] =&gt;; 1
      [edit_posts] =&gt;; 1
      [edit_others_posts] =&gt;; 1
      [edit_published_posts] =&gt;; 1
      [publish_posts] =&gt;; 1
      [edit_pages] =&gt;; 1
      [read] =&gt;; 1
      [level_10] =&gt;; 1
      [level_9] =&gt;; 1
      [level_8] =&gt;; 1
      [level_7] =&gt;; 1
      [level_6] =&gt;; 1
      [level_5] =&gt;; 1
      [level_4] =&gt;; 1
      [level_3] =&gt;; 1
      [level_2] =&gt;; 1
      [level_1] =&gt;; 1
      [level_0] =&gt;; 1
      [edit_others_pages] =&gt;; 1
      [edit_published_pages] =&gt;; 1
      [publish_pages] =&gt;; 1
      [delete_pages] =&gt;; 1
      [delete_others_pages] =&gt;; 1
      [delete_published_pages] =&gt;; 1
      [delete_posts] =&gt;; 1
      [delete_others_posts] =&gt;; 1
      [delete_published_posts] =&gt;; 1
      [delete_private_posts] =&gt;; 1
      [edit_private_posts] =&gt;; 1
      [read_private_posts] =&gt;; 1
      [delete_private_pages] =&gt;; 1
      [edit_private_pages] =&gt;; 1
      [read_private_pages] =&gt;; 1
      [delete_users] =&gt;; 1
      [create_users] =&gt;; 1
      [unfiltered_upload] =&gt;; 1
      [edit_dashboard] =&gt;; 1
      [update_plugins] =&gt;; 1
      [delete_plugins] =&gt;; 1
      [install_plugins] =&gt;; 1
      [update_themes] =&gt;; 1
      [install_themes] =&gt;; 1
      [update_core] =&gt;; 1
      [list_users] =&gt;; 1
      [remove_users] =&gt;; 1
      [promote_users] =&gt;; 1
      [edit_theme_options] =&gt;; 1
      [delete_themes] =&gt;; 1
      [export] =&gt;; 1
      [manage_woocommerce] =&gt;; 1
      [view_woocommerce_reports] =&gt;; 1
      [edit_product] =&gt;; 1
      [read_product] =&gt;; 1
      [delete_product] =&gt;; 1
      [edit_products] =&gt;; 1
      [edit_others_products] =&gt;; 1
      [publish_products] =&gt;; 1
      [read_private_products] =&gt;; 1
      [delete_products] =&gt;; 1
      [delete_private_products] =&gt;; 1
      [delete_published_products] =&gt;; 1
      [delete_others_products] =&gt;; 1
      [edit_private_products] =&gt;; 1
      [edit_published_products] =&gt;; 1
      [manage_product_terms] =&gt;; 1
      [edit_product_terms] =&gt;; 1
      [delete_product_terms] =&gt;; 1
      [assign_product_terms] =&gt;; 1
      [edit_shop_order] =&gt;; 1
      [read_shop_order] =&gt;; 1
      [delete_shop_order] =&gt;; 1
      [edit_shop_orders] =&gt;; 1
      [edit_others_shop_orders] =&gt;; 1
      [publish_shop_orders] =&gt;; 1
      [read_private_shop_orders] =&gt;; 1
      [delete_shop_orders] =&gt;; 1
      [delete_private_shop_orders] =&gt;; 1
      [delete_published_shop_orders] =&gt;; 1
      [delete_others_shop_orders] =&gt;; 1
      [edit_private_shop_orders] =&gt;; 1
      [edit_published_shop_orders] =&gt;; 1
      [manage_shop_order_terms] =&gt;; 1
      [edit_shop_order_terms] =&gt;; 1
      [delete_shop_order_terms] =&gt;; 1
      [assign_shop_order_terms] =&gt;; 1
      [edit_shop_coupon] =&gt;; 1
      [read_shop_coupon] =&gt;; 1
      [delete_shop_coupon] =&gt;; 1
      [edit_shop_coupons] =&gt;; 1
      [edit_others_shop_coupons] =&gt;; 1
      [publish_shop_coupons] =&gt;; 1
      [read_private_shop_coupons] =&gt;; 1
      [delete_shop_coupons] =&gt;; 1
      [delete_private_shop_coupons] =&gt;; 1
      [delete_published_shop_coupons] =&gt;; 1
      [delete_others_shop_coupons] =&gt;; 1
      [edit_private_shop_coupons] =&gt;; 1
      [edit_published_shop_coupons] =&gt;; 1
      [manage_shop_coupon_terms] =&gt;; 1
      [edit_shop_coupon_terms] =&gt;; 1
      [delete_shop_coupon_terms] =&gt;; 1
      [assign_shop_coupon_terms] =&gt;; 1
      [administrator] =&gt;; 1
  )
  </code></pre>