| @@ -42,11 +42,12 @@ | ||
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Checks if a given request has access to read menu items if they have access to edit them. |
| 45 | 45 | * |
| 46 | + * @param WP_REST_Request $request Full details about the request. | |
| 46 | 47 | * @return true|WP_Error True if the request has read access, WP_Error object otherwise. |
| 47 | 48 | */ |
| 48 | - public function permissions_check() { | |
| 49 | + public function permissions_check( $request ) { | |
| 49 | 50 | $post_type = get_post_type_object( 'nav_menu_item' ); |
| 50 | 51 | if ( ! current_user_can( $post_type->cap->edit_posts ) ) { |
| 51 | 52 | return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit posts in this post type.', 'gutenberg' ), array( 'status' => rest_authorization_required_code() ) ); |
| 52 | 53 | } |