wordpress - Woocommerce API Read Only On Products -
i want give user ability view (read) products using woocommerce api only. have looked everywhere , although there role "permissions" read_product, doesn't seem linked api features or inherit user's web browsing permissions. when trying view read results, response "code": "woocommerce_rest_cannot_view", 401 error... note: not api authentication issue, can view products , authenticate totally fine using administrator level keys on basic auth no problem.
i found through digging , wondering how use hook see "read_product" permission , grant api user read access products querying on api role permission. unfortunately there little documentation on how works seems need use.
add_filter( 'woocommerce_rest_check_permissions', 'my_woocommerce_rest_check_permissions', 90, 4 ); function my_woocommerce_rest_check_permissions( $permission, $context, $object_id, $post_type ){ } anyone done or know do?
Comments
Post a Comment