Skip to content

Commit

Permalink
Site Health: fix check name used for REST API permission checks.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
swissspidy committed Aug 29, 2023
1 parent ec94944 commit ab5fd4d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function register_routes() {
'methods' => 'GET',
'callback' => array( $this, 'get_directory_sizes' ),
'permission_callback' => function() {
return $this->validate_request_permission( 'debug_enabled' ) && ! is_multisite();
return $this->validate_request_permission( 'directory_sizes' ) && ! is_multisite();
},
)
);
Expand All @@ -170,7 +170,7 @@ public function register_routes() {
'methods' => 'GET',
'callback' => array( $this, 'test_page_cache' ),
'permission_callback' => function () {
return $this->validate_request_permission( 'view_site_health_checks' );
return $this->validate_request_permission( 'page_cache' );
},
),
)
Expand Down

0 comments on commit ab5fd4d

Please sign in to comment.