my-projects-website/app/application/app/Policies/ProjectLinkPolicy.php

35 lines
806 B
PHP

<?php declare(strict_types=1);
namespace App\Policies;
use App\Models\ProjectLink;
use App\Models\User;
final readonly class ProjectLinkPolicy extends Policy
{
public function viewAny(User $user): bool
{
return $user->hasPermission('project-link.view');
}
public function view(User $user, ProjectLink $link): bool
{
return $user->hasPermission('project-link.view');
}
public function create(User $user): bool
{
return $user->hasPermission('project-link.create');
}
public function update(User $user, ProjectLink $link): bool
{
return $user->hasPermission('project-link.update');
}
public function delete(User $user, ProjectLink $link): bool
{
return $user->hasPermission('project-link.delete');
}
}