diff --git a/app/Models/Concerns/InteractsWithRoles.php b/app/Models/Concerns/InteractsWithRoles.php index 956377d..ce4d09b 100644 --- a/app/Models/Concerns/InteractsWithRoles.php +++ b/app/Models/Concerns/InteractsWithRoles.php @@ -26,6 +26,14 @@ trait InteractsWithRoles return $this->hasRole('admin'); } + /** + * Check if user is direktor + */ + public function isDirektor(): bool + { + return $this->hasRole('direktor'); + } + /** * Check if user is manager */ diff --git a/app/Nova/Actions/Ecommerce/Product/ProductImportAction.php b/app/Nova/Actions/Ecommerce/Product/ProductImportAction.php index 56d23b8..7118515 100644 --- a/app/Nova/Actions/Ecommerce/Product/ProductImportAction.php +++ b/app/Nova/Actions/Ecommerce/Product/ProductImportAction.php @@ -50,7 +50,7 @@ class ProductImportAction extends Action ->displayUsingLabels() ->searchable() ->options(function () { - if (auth()->user()->isAdmin()) { + if (auth()->user()->isAdmin() || auth()->user()->isDirektor()) { return ChannelRepository::values(); }