Skip to content

Commit ab5fd4d

Browse files
committed
Site Health: fix check name used for REST API permission checks.
Updates the calls to permission validation calls for the `directory-sizes` and `page-cache` routes to actually match the route names. Follow-up to r54043 and r49154. Props szepeviktor. Fixes #59236 git-svn-id: https://develop.svn.wordpress.org/trunk@56489 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ec94944 commit ab5fd4d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function register_routes() {
153153
'methods' => 'GET',
154154
'callback' => array( $this, 'get_directory_sizes' ),
155155
'permission_callback' => function() {
156-
return $this->validate_request_permission( 'debug_enabled' ) && ! is_multisite();
156+
return $this->validate_request_permission( 'directory_sizes' ) && ! is_multisite();
157157
},
158158
)
159159
);
@@ -170,7 +170,7 @@ public function register_routes() {
170170
'methods' => 'GET',
171171
'callback' => array( $this, 'test_page_cache' ),
172172
'permission_callback' => function () {
173-
return $this->validate_request_permission( 'view_site_health_checks' );
173+
return $this->validate_request_permission( 'page_cache' );
174174
},
175175
),
176176
)

0 commit comments

Comments
 (0)