Skip to content

Commit

Permalink
Prevent seeing voters list if user cannot see votes count
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin committed Jul 15, 2023
1 parent 39ff9ff commit 19f4708
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Access/PollPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ public function seeVoteCount(User $actor, Poll $poll)

public function seeVoters(User $actor, Poll $poll)
{
if (($poll->myVotes($actor)->count() || $actor->can('polls.viewResultsWithoutVoting', $poll->post->discussion)) && $poll->public_poll) {
if (!$actor->can('seeVoteCount', $poll)) {
return $this->deny();
}

if ($poll->public_poll) {
return $this->allow();
}
}
Expand Down

0 comments on commit 19f4708

Please sign in to comment.