First Commit

This commit is contained in:
marco
2026-09-01 09:22:30 -03:00
commit a43ae23eb4
407 changed files with 36138 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use App\Models\LegalDocument;
use App\Models\User;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Auth\Access\Response;
class LegalDocumentPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->role === 'superadmin';
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, LegalDocument $document): bool
{
return true;
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->role === 'superadmin';
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, LegalDocument $document): bool
{
return $user->role === 'superadmin';
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, LegalDocument $document): bool
{
return $user->role === 'superadmin';
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, LegalDocument $document): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, LegalDocument $document): bool
{
return false;
}
}