Added the ability to add links to the project.

This commit is contained in:
2024-04-15 22:53:34 +05:00
parent 4583908230
commit 63ea5dac92
29 changed files with 756 additions and 13 deletions

View File

@@ -0,0 +1,34 @@
<?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');
}
}