Added the ability to add project information.
This commit is contained in:
29
app/application/app/Policies/ProjectContentPolicy.php
Normal file
29
app/application/app/Policies/ProjectContentPolicy.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\ProjectContent;
|
||||
use App\Models\User;
|
||||
|
||||
final readonly class ProjectContentPolicy extends Policy
|
||||
{
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->hasPermission('project-content.view');
|
||||
}
|
||||
|
||||
public function view(User $user, ProjectContent $projectContent): bool
|
||||
{
|
||||
return $user->hasPermission('project-content.view');
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->hasPermission('project-content.create');
|
||||
}
|
||||
|
||||
public function update(User $user, ProjectContent $projectContent): bool
|
||||
{
|
||||
return $user->hasPermission('project-content.update');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user