Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
484e3ee
Add a new endpoint that exposes block editor settings through the RES…
Tug Sep 10, 2020
9737fbc
Merge branch 'master' into add/block-editor-settings-rest-endpoint
Feb 25, 2021
0b90f30
Update permission check
Feb 25, 2021
ba80bcc
Global styles - Add check for mobile
Mar 1, 2021
d1cc0f5
Fix lint issues
Mar 1, 2021
1cfd9d1
Merge branch 'trunk' into add/block-editor-settings-rest-endpoint
Mar 15, 2021
052d241
Block editor mobile settings endpoint
Mar 16, 2021
b4205d5
Move theme support data within the if condition
Mar 17, 2021
d332e6e
Add schema
Mar 18, 2021
e3e1c77
Update naming
Mar 18, 2021
2c7abac
Update endpoint name
Mar 22, 2021
ffe9ac1
Use require_once
Mar 22, 2021
6837fa7
Use block editor settings
Mar 25, 2021
d9f3277
Merge branch 'trunk' into add/global-styles-mobile-endpoint
Apr 8, 2021
e18eaa3
Merge branch 'trunk' into add/global-styles-mobile-endpoint
Apr 19, 2021
2328ff6
Usage of get_default_block_editor_settings for the rest api endpoint
Apr 5, 2021
ede0fc1
Block editor settings update schema
Apr 19, 2021
ddb0dcd
Merge branch 'trunk' into add/global-styles-mobile-endpoint
Apr 20, 2021
3a3908f
Add context as a param to get the block editor settings, update permi…
Apr 20, 2021
108debd
Remove unneeded filter
Apr 20, 2021
2d24002
Remove unneeded changes
Apr 20, 2021
ec6fa21
Update context in schema
Apr 21, 2021
f5db2fc
Update context for global styles attributes
Apr 26, 2021
3897d19
Update class-wp-rest-block-editor-settings-controller.php
gziolo May 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update permission check
  • Loading branch information
Gerardo Pacheco committed Feb 25, 2021
commit 0b90f30948c3c9c7e20dd3ed9b0221378da56ca7
2 changes: 1 addition & 1 deletion lib/class-wp-rest-block-editor-settings-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function register_routes() {
* @return WP_Error|bool True if the request has permission, WP_Error object otherwise.
*/
public function get_items_permissions_check( $request ) {
if ( ! current_user_can( 'edit_post', $request['id'] ) ) {
if ( ! current_user_can( 'edit_posts' ) ) {
$error = __( 'Sorry, you are not allowed to read the block editor settings.', 'gutenberg' );
return new WP_Error( 'rest_cannot_read_settings', $error, array( 'status' => rest_authorization_required_code() ) );
}
Expand Down