From 8f02084d3adb83b506e2de6902fa2dbe7b4da567 Mon Sep 17 00:00:00 2001 From: mirivlad Date: Thu, 26 Mar 2026 13:54:02 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20TestPolicy=20-=20=D0=B2=D0=BE=D0=B7=D0=B2?= =?UTF-8?q?=D1=80=D0=B0=D1=89=D0=B0=D1=82=D1=8C=20true=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D1=80=D0=BE=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Qwen-Coder --- app/Policies/TestPolicy.php | 42 +++++-------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/app/Policies/TestPolicy.php b/app/Policies/TestPolicy.php index ffcdcf2..4e9e368 100755 --- a/app/Policies/TestPolicy.php +++ b/app/Policies/TestPolicy.php @@ -4,63 +4,31 @@ namespace App\Policies; use App\Models\Test; use App\Models\User; -use Illuminate\Auth\Access\Response; class TestPolicy { - /** - * Determine whether the user can view any models. - */ public function viewAny(User $user): bool { - return false; + return $user->hasRole(['Administrator', 'Manager', 'Curator']); } - /** - * Determine whether the user can view the model. - */ public function view(User $user, Test $test): bool { - return false; + return $user->hasRole(['Administrator', 'Manager', 'Curator']); } - /** - * Determine whether the user can create models. - */ public function create(User $user): bool { - return false; + return $user->hasRole(['Administrator', 'Manager', 'Curator']); } - /** - * Determine whether the user can update the model. - */ public function update(User $user, Test $test): bool { - return false; + return $user->hasRole(['Administrator', 'Manager', 'Curator']); } - /** - * Determine whether the user can delete the model. - */ public function delete(User $user, Test $test): bool { - return false; - } - - /** - * Determine whether the user can restore the model. - */ - public function restore(User $user, Test $test): bool - { - return false; - } - - /** - * Determine whether the user can permanently delete the model. - */ - public function forceDelete(User $user, Test $test): bool - { - return false; + return $user->hasRole(['Administrator', 'Manager']); } }