How to grant custom role access tp REST API in Gutenberg


I am using the PublishPress-Capabilities plugin to manage custom user roles. Unfortunately, my custom users are unable to make calls to the WP REST API in the Gutenberg editor, as happens when trying to add a query block to a post or using tools that rely on the API, e.g. Font Awesome. All calls to the REST API receive this 403 response:

{"code":"rest_forbidden","message":"Sorry, you are not allowed to do that.","data":{"status":403}}

I have found numerous articles telling me I can use the rest_authentication_errors filter to restrict certain people from accessing the API, but I haven’t found any information on how to grant certain types of users/roles access to the API.

Is there any way to do this, either via the plugin I am using or by adding a hook in functions.php?

Eric 3 weeks 2023-03-12T17:15:54-05:00 0 Answers 0 views 0

Leave an answer