Conditions | 1 |
Paths | 1 |
Total Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function voteOnAttribute(string $attribute, Post $post, UserId $userId): bool |
||
33 | { |
||
34 | // the logic of this voter is pretty simple: if the logged user is the |
||
35 | // author of the given blog post, grant permission; otherwise, deny it. |
||
36 | // (the supports() method guarantees that $post is a Post object) |
||
37 | return $userId->equals($post->getAuthorId()); |
||
38 | } |
||
39 | } |
||
40 |