35 lines
686 B
PHP
35 lines
686 B
PHP
<?php
|
|
|
|
namespace App\Domain\Cms;
|
|
|
|
use App\Domain\Identity\StaffRole;
|
|
use App\Models\User;
|
|
|
|
class NavigationItemPolicy
|
|
{
|
|
public function viewAny(User $user): bool
|
|
{
|
|
return $user->hasStaffRole(StaffRole::Redakteur);
|
|
}
|
|
|
|
public function view(User $user, NavigationItem $item): bool
|
|
{
|
|
return $this->viewAny($user);
|
|
}
|
|
|
|
public function create(User $user): bool
|
|
{
|
|
return $this->viewAny($user);
|
|
}
|
|
|
|
public function update(User $user, NavigationItem $item): bool
|
|
{
|
|
return $this->viewAny($user);
|
|
}
|
|
|
|
public function delete(User $user, NavigationItem $item): bool
|
|
{
|
|
return $this->viewAny($user);
|
|
}
|
|
}
|