Add isDirektor role check to user model and update product import action to include direktor permissions
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user