Skip to content

Commit

Permalink
Improve readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-vlasenko authored and Anton Vlasenko committed Feb 2, 2024
1 parent 048d0d3 commit 8810a32
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,17 @@ public function get_collection_params() {
* @return true|WP_Error True if the request has write access for the item, WP_Error object otherwise.
*/
public function get_items_permissions_check( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable

if ( ! current_user_can( 'edit_theme_options' ) ) {
return new WP_Error(
'rest_cannot_read',
__( 'Sorry, you are not allowed to use the Font Library on this site.', 'gutenberg' ),
array(
'status' => rest_authorization_required_code(),
)
);
if ( current_user_can( 'edit_theme_options' ) ) {
return true;
}
return true;

return new WP_Error(
'rest_cannot_read',
__( 'Sorry, you are not allowed to use the Font Library on this site.', 'gutenberg' ),
array(
'status' => rest_authorization_required_code(),
)
);
}
}
}

0 comments on commit 8810a32

Please sign in to comment.