We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a8aaae commit 01f3813Copy full SHA for 01f3813
security/voters.rst
@@ -186,7 +186,7 @@ would look like this::
186
187
return match($attribute) {
188
self::VIEW => $this->canView($post, $user),
189
- self::EDIT => $this->canEdit($post, $user),
+ self::EDIT => $this->canEdit($post, $user, $vote),
190
default => throw new \LogicException('This code should not be reached!')
191
};
192
}
@@ -202,7 +202,7 @@ would look like this::
202
return !$post->isPrivate();
203
204
205
- private function canEdit(Post $post, User $user): bool
+ private function canEdit(Post $post, User $user, ?Vote $vote): bool
206
{
207
// this assumes that the Post object has a `getAuthor()` method
208
if ($user === $post->getAuthor()) {
0 commit comments