-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Description
Found while working on #32868. This is currently blocking #32868, as it causes e2e tests to fail 😕
Repro'd on current GB trunk.
Step-by-step reproduction instructions
- Log into WP as a non-admin user (e.g. Editor role).
- Create a new post.
- Open your browser devtools bar (Network tab), and clear it.
- Insert a 'Site Title' block
Expected behaviour
No network request to fail with a 403.
Actual behaviour
The network request to GET http://localhost:8888/index.php?rest_route=%2Fwp%2Fv2%2Fsettings%2F&_locale=user comes back with a 403 error, with the following response:
{
"code": "rest_forbidden",
"message": "Sorry, you are not allowed to do that.",
"data": { "status": 403 }
}The error is also visible in the devtools console, including a stacktrace. While minimized, it seems to be caused by this line:
| const [ title, setTitle ] = useEntityProp( 'root', 'site', 'title' ); |
Bonus
If you enter 'Site' into the block picker to locate the Site Title block, there's another network request that fails with a 403:
GET http://localhost:8888/index.php?rest_route=/wp/v2/users&context=edit&per_page=100&_locale=user fails with
{
"code": "rest_forbidden_context",
"message": "Sorry, you are not allowed to list users.",
"data": { "status": 403 }
}The stack trace points to the Query Loop block for this one:
gutenberg/packages/block-library/src/query/edit/query-inspector-controls.js
Lines 88 to 90 in afee31e
| authorList: getEntityRecords( 'root', 'user', { | |
| per_page: -1, | |
| } ), |
This latter 403 also causes an Uncaught (in promise) error to be logged in the browser console.
cc/ @ntsekouras