diff --git a/app/Models/User.php b/app/Models/User.php index fc34187..6aac6fe 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -22,7 +22,8 @@ class User extends Authenticatable 'username', 'email', 'password', - 'type' + 'type', + 'email_verified_at' ]; /** diff --git a/app/Policies/TestPolicy.php b/app/Policies/TestPolicy.php index 1229129..14d5160 100644 --- a/app/Policies/TestPolicy.php +++ b/app/Policies/TestPolicy.php @@ -35,17 +35,17 @@ class TestPolicy /** * Determine whether the user can update the model. */ - public function update(User $user, Test $question): bool + public function update(User $user, Test $test): bool { - return $user->type == 'admin' || $question->user_id == $user->id; + return $user->type == 'admin' || $test->author_id == $user->id; } /** * Determine whether the user can delete the model. */ - public function delete(User $user, Test $question): bool + public function delete(User $user, Test $test): bool { - return $user->type == 'admin' || $question->user_id == $user->id; + return $user->type == 'admin' || $test->author_id == $user->id; } /**