Title: UserRoleEditor affecting REST API?
Last modified: June 1, 2021

---

# UserRoleEditor affecting REST API?

 *  [Mortenz](https://wordpress.org/support/users/mortenz/)
 * (@mortenz)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/userroleeditor-affecting-rest-api/)
 * We are using WooCommerce with a plugin (Shipmondo) to help with shipping. This
   plugin has it’s own control panel, which connects with the REST API in WordPress,
   to process orders.
 * Ever since we installed User Role Editor, we get this error from the shipping
   control panel , when we try to complete an order: {“code”:”woocommerce_rest_cannot_edit”,”
   message”:”Sorry, you are not allowed to edit this resource.”,”data”:{“status”:
   401}}
 * My first guess was the problem was caused by User Role Editor. So I tried to 
   disable the plugin, but the problem still wasn’t fixed.
 * The shipping plugin was working fine before I installed URE. So do you know if
   URE has any effect on the REST API?
 * Kind Regards
    Morten
    -  This topic was modified 4 years, 11 months ago by [Mortenz](https://wordpress.org/support/users/mortenz/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/userroleeditor-affecting-rest-api/#post-14514557)
 * Hi Morten,
 * URE does not change itself permissions required by WordPress or WooCommerce Rest
   API.
 * Check if your user can permission checked by WooCommerce REST API. For example,
   WooCommerce file class-wc-rest-shipping-zones-controller-base.php checks user
   permissions via function below, and requires ‘manage_woocommerce’ for ‘shipping_methods’
   $object argument value:
 *     ```
       /**
        * Check manager permissions on REST API.
        *
        * @since 2.6.0
        * @param string $object  Object.
        * @param string $context Request context.
        * @return bool
        */
       function wc_rest_check_manager_permissions( $object, $context = 'read' ) {
       	$objects = array(
       		'reports'          => 'view_woocommerce_reports',
       		'settings'         => 'manage_woocommerce',
       		'system_status'    => 'manage_woocommerce',
       		'attributes'       => 'manage_product_terms',
       		'shipping_methods' => 'manage_woocommerce',
       		'payment_gateways' => 'manage_woocommerce',
       		'webhooks'         => 'manage_woocommerce',
       	);
   
       	$permission = current_user_can( $objects[ $object ] );
   
       	return apply_filters( 'woocommerce_rest_check_permissions', $permission, $context, 0, $object );
       }
       ```
   
    -  This reply was modified 4 years, 11 months ago by [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/).
    -  This reply was modified 4 years, 11 months ago by [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/).
    -  This reply was modified 4 years, 11 months ago by [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/).

Viewing 1 replies (of 1 total)

The topic ‘UserRoleEditor affecting REST API?’ is closed to new replies.

 * ![](https://ps.w.org/user-role-editor/assets/icon-256x256.jpg?rev=1020390)
 * [User Role Editor](https://wordpress.org/plugins/user-role-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-role-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-role-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/user-role-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-role-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-role-editor/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/userroleeditor-affecting-rest-api/#post-14514557)
 * Status: not resolved