{"action":"created","issue":{"url":"https://api.github.com/repos/woothemes/woocommerce/issues/10379","repository_url":"https://api.github.com/repos/woothemes/woocommerce","labels_url":"https://api.github.com/repos/woothemes/woocommerce/issues/10379/labels{/name}","comments_url":"https://api.github.com/repos/woothemes/woocommerce/issues/10379/comments","events_url":"https://api.github.com/repos/woothemes/woocommerce/issues/10379/events","html_url":"https://github.com/woothemes/woocommerce/issues/10379","id":134524863,"number":10379,"title":"REST API: User with \"edit product\" capability only cannot create new product for submit review","user":{"login":"whyka","id":1247539,"avatar_url":"https://avatars.githubusercontent.com/u/1247539?v=3","gravatar_id":"","url":"https://api.github.com/users/whyka","html_url":"https://github.com/whyka","followers_url":"https://api.github.com/users/whyka/followers","following_url":"https://api.github.com/users/whyka/following{/other_user}","gists_url":"https://api.github.com/users/whyka/gists{/gist_id}","starred_url":"https://api.github.com/users/whyka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whyka/subscriptions","organizations_url":"https://api.github.com/users/whyka/orgs","repos_url":"https://api.github.com/users/whyka/repos","events_url":"https://api.github.com/users/whyka/events{/privacy}","received_events_url":"https://api.github.com/users/whyka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-18T09:22:40Z","updated_at":"2016-02-18T16:22:06Z","closed_at":null,"body":"I want to thank you for this great plugin.\r\nHowever I have a problem with user roles. My site allows contributors (with \"edit product\" capability) create new product via review stage. This feature works fine on Dashboard but failed on API POST /wc-api/v3/products. Note that I already set status to draft or pending\r\n```\r\n{\r\n  \"product\": {\r\n    \"status\": \"pending\",\r\n...\r\n```\r\n\r\nAs I read the source code, the following causes the problem:\r\n```\r\n// Check permissions.\r\nif ( ! current_user_can( 'publish_products' ) ) {\r\n\tthrow new WC_API_Exception( 'woocommerce_api_user_cannot_create_product', __( 'You do not have permission to create products', 'woocommerce' ), 401 );\r\n}\r\n\r\nI think it is helpful if can extend WooCommerce but not figure out how.\r\nThank you for any help."},"comment":{"url":"https://api.github.com/repos/woothemes/woocommerce/issues/comments/185800111","html_url":"https://github.com/woothemes/woocommerce/issues/10379#issuecomment-185800111","issue_url":"https://api.github.com/repos/woothemes/woocommerce/issues/10379","id":185800111,"user":{"login":"claudiosmweb","id":1264099,"avatar_url":"https://avatars.githubusercontent.com/u/1264099?v=3","gravatar_id":"","url":"https://api.github.com/users/claudiosmweb","html_url":"https://github.com/claudiosmweb","followers_url":"https://api.github.com/users/claudiosmweb/followers","following_url":"https://api.github.com/users/claudiosmweb/following{/other_user}","gists_url":"https://api.github.com/users/claudiosmweb/gists{/gist_id}","starred_url":"https://api.github.com/users/claudiosmweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudiosmweb/subscriptions","organizations_url":"https://api.github.com/users/claudiosmweb/orgs","repos_url":"https://api.github.com/users/claudiosmweb/repos","events_url":"https://api.github.com/users/claudiosmweb/events{/privacy}","received_events_url":"https://api.github.com/users/claudiosmweb/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T16:22:06Z","updated_at":"2016-02-18T16:22:06Z","body":"We'll add some filters for permissions soon."}}