| @@ -80,9 +80,13 @@ | ||
| 80 | 80 | case 'PATCH': |
| 81 | 81 | case 'DELETE': |
| 82 | 82 | return current_user_can('yatra_edit_trips'); |
| 83 | 83 | default: |
| 84 | - return current_user_can('manage_options'); | |
| 84 | + // Unknown HTTP method — deny explicitly. The earlier | |
| 85 | + // fallback to `manage_options` was a regression that | |
| 86 | + // silently broadened admin-only access for any verb not | |
| 87 | + // in the explicit switch. | |
| 88 | + return false; | |
| 85 | 89 | } |
| 86 | 90 | } |
| 87 | 91 | |
| 88 | 92 | public function get_items(WP_REST_Request $request) |