You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working on updating custom post type ACF fields, with granular permissions, and having problems with rest_forbidden 403 error code.
Here's My Situation:
I have a custom post type called "myct" created using CPT UI, it's capability type is also called "myct" and it has ACF fields
Only users with the Role "myrole" can create/edit the post type (tested using WP dashboard).
The API is using JWT as well for auth
Expected Behavior
I was expecting editing capabilities while updating fields to match what we have using wp backend.
Actual Behavior
If the user does NOT have the edit_post capability, he can't update a field (/acf/v3/myct/:id), resulting in a rest_forbidden error;
If the user HAVE edit_post capability, he CAN update the field
If the user have edit_post, but does NOT have edit_others_posts, meaning, he can edit only his own posts, using the API he can edit anyone's post fields
Conclusion
I've been playing with role/caps/rest for a while on a granular level, but I still can't accept the fact that capabilities are not tight via WP REST, this in my honest opinion, and this might be a security issue, if bob gives alice a role the edit_post cap, and alice being able to edit anyone's post fields, even though she doesn't have the edit_others_posts cap, can cause damage.
I will be looking into this closely in the following days, any feedback is appreciated.
Will keep you posted ;)
Muito Obrigado e parabéns pelo trampo no plugin \o/
Trying to update a user custom field.
Authentication via JWT that is working because I'm able to update regular fields.
This my Json:`
Those are my filters:
// Enable the option show in rest
Getting:
The text was updated successfully, but these errors were encountered: