diff --git src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php
index dbfaa839cb..3494a1f78c 100644
|
|
class WP_REST_Themes_Controller extends WP_REST_Controller { |
58 | 58 | * @return true|WP_Error True if the request has read access for the item, otherwise WP_Error object. |
59 | 59 | */ |
60 | 60 | public function get_items_permissions_check( $request ) { |
61 | | if ( ! is_user_logged_in() || ! current_user_can( 'edit_posts' ) ) { |
| 61 | if ( ! is_user_logged_in() || ! ( current_user_can( 'edit_posts' ) || current_user_can( 'upload_files' ) ) ) { |
62 | 62 | return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to view themes.' ), array( 'status' => rest_authorization_required_code() ) ); |
63 | 63 | } |
64 | 64 | |