From 6ed76547731f74eda3435c770c42c8033568ae3d Mon Sep 17 00:00:00 2001 From: mirivlad Date: Thu, 26 Mar 2026 16:50:27 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20QuestionPolicy=20=D0=B2=D0=BE=D0=B7?= =?UTF-8?q?=D0=B2=D1=80=D0=B0=D1=89=D0=B0=D0=BB=20false=20-=20=D0=B8=D1=81?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D1=83=20=D1=80=D0=BE?= =?UTF-8?q?=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/QuestionPolicy.php | 42 ++++----------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/app/Policies/QuestionPolicy.php b/app/Policies/QuestionPolicy.php index a46d5ab..597c809 100755 --- a/app/Policies/QuestionPolicy.php +++ b/app/Policies/QuestionPolicy.php @@ -4,63 +4,31 @@ namespace App\Policies; use App\Models\Question; use App\Models\User; -use Illuminate\Auth\Access\Response; class QuestionPolicy { - /** - * 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, Question $question): 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, Question $question): bool { - return false; + return $user->hasRole(['Administrator', 'Manager', 'Curator']); } - /** - * Determine whether the user can delete the model. - */ public function delete(User $user, Question $question): bool { - return false; - } - - /** - * Determine whether the user can restore the model. - */ - public function restore(User $user, Question $question): bool - { - return false; - } - - /** - * Determine whether the user can permanently delete the model. - */ - public function forceDelete(User $user, Question $question): bool - { - return false; + return $user->hasRole(['Administrator', 'Manager']); } }