Prevent CRUD of product variations via API.
-
Hello! Hopefully someone can help me with this API question.
Im using the ‘woocommerce_rest_check_permissions’ filter to prevent users from the API from editing products that are not theirs. My development on this is working great so far, but Im trying to prevent users from editing variations of PRODUCTS that arent theirs and I cant make it work, the $object_id is always 0 for some reason.
EXAMPLE: I have the product with id 500, this product belongs to someone else and I cannot touch it, HOWEVER, I can edit, create, list and delete variations from this product (products/500/variations/501, for example, and delete the variation), even though the parent product is not mine. How can I prevent this from happening ?
Thank you in advance!
- The topic ‘Prevent CRUD of product variations via API.’ is closed to new replies.