Skip to content

Commit 37d6c72

Browse files
committed
minor #21006 [Security] Update voters.rst (ifiroth)
This PR was merged into the 7.3 branch. Discussion ---------- [Security] Update voters.rst I think you're missing an argument here <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `7.x` for features of unreleased versions). --> Commits ------- 01f3813 Update voters.rst
2 parents e6ba3a9 + 01f3813 commit 37d6c72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security/voters.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ would look like this::
186186

187187
return match($attribute) {
188188
self::VIEW => $this->canView($post, $user),
189-
self::EDIT => $this->canEdit($post, $user),
189+
self::EDIT => $this->canEdit($post, $user, $vote),
190190
default => throw new \LogicException('This code should not be reached!')
191191
};
192192
}
@@ -202,7 +202,7 @@ would look like this::
202202
return !$post->isPrivate();
203203
}
204204

205-
private function canEdit(Post $post, User $user): bool
205+
private function canEdit(Post $post, User $user, ?Vote $vote): bool
206206
{
207207
// this assumes that the Post object has a `getAuthor()` method
208208
if ($user === $post->getAuthor()) {

0 commit comments

Comments
 (0)