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