| @@ -13,10 +13,14 @@ | ||
| 13 | 13 | * @return \FluentBooking\App\Models\Calendar|\WP_Error |
| 14 | 14 | */ |
| 15 | 15 | public function importHostJson($data, $useCurrentUser = true) |
| 16 | 16 | { |
| 17 | - if (!PermissionManager::userCan(['manage_all_data', 'invite_team_members', 'manage_other_calendars'])) { | |
| 17 | + if (!PermissionManager::userCan(['manage_all_data', 'manage_other_calendars'])) { | |
| 18 | 18 | return new \WP_Error('invalid_data', __('You are not authorized to import calendar', 'fluent-booking')); |
| 19 | + } | |
| 20 | + | |
| 21 | + if (!$useCurrentUser && !PermissionManager::userCan('manage_all_data')) { | |
| 22 | + $useCurrentUser = true; | |
| 19 | 23 | } |
| 20 | 24 | |
| 21 | 25 | if (is_string($data)) { |
| 22 | 26 | $data = json_decode($data, true); |