Skip to content

Commit

Permalink
Fix issue in policy, allowing publish ranking without quiz being publ…
Browse files Browse the repository at this point in the history
…ished
  • Loading branch information
PrabuckiDominik committed Sep 11, 2024
1 parent e8ca731 commit ffaa248
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Policies/QuizPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function assign(User $user, Quiz $quiz): bool

public function viewAdminRanking(User $user, Quiz $quiz): Response
{
return ($quiz->isLocked && $user->hasRole("admin|super_admin")) ? Response::allow() : Response::deny("Nie masz uprawnień do zobaczenia rankingu.");
return ($quiz->isPublished && $user->hasRole("admin|super_admin")) ? Response::allow() : Response::deny("Nie masz uprawnień do zobaczenia rankingu.");
}

public function viewUserRanking(User $user, Quiz $quiz): Response
Expand Down

0 comments on commit ffaa248

Please sign in to comment.