| @@ -3,8 +3,9 @@ | ||
| 3 | 3 | namespace FluentForm\App\Services; |
| 4 | 4 | |
| 5 | 5 | use FluentForm\App\Helpers\Helper; |
| 6 | 6 | use FluentForm\App\Models\Form; |
| 7 | +use FluentForm\App\Services\Manager\FormManagerService; | |
| 7 | 8 | |
| 8 | 9 | class GlobalSearchService |
| 9 | 10 | { |
| 10 | 11 | |
| @@ -385,9 +386,13 @@ | ||
| 385 | 386 | ], |
| 386 | 387 | ]); |
| 387 | 388 | } |
| 388 | 389 | |
| 390 | + $allowedForms = FormManagerService::getUserAllowedFormsScope(); | |
| 389 | 391 | $forms = Form::where('status', 'published') |
| 392 | + ->when(false !== $allowedForms, function ($q) use ($allowedForms) { | |
| 393 | + $q->whereIn('id', $allowedForms ?: [0]); | |
| 394 | + }) | |
| 390 | 395 | ->select(['id', 'title', 'type'])->get(); |
| 391 | 396 | if (count($forms) > 0) { |
| 392 | 397 | foreach ($forms as $form) { |
| 393 | 398 | $formSpecificLinks = [ |