1 | <?php |
||
21 | class CommentPolicy |
||
22 | { |
||
23 | use HandlesAuthorization, ProjectAccess; |
||
24 | |||
25 | /** |
||
26 | * @param User $user |
||
27 | * |
||
28 | * @return bool |
||
29 | */ |
||
30 | public function before(User $user) |
||
36 | |||
37 | /** |
||
38 | * Determine whether the user can view the comment. |
||
39 | * |
||
40 | * @param User $user |
||
41 | * @param Comment $comment |
||
42 | * |
||
43 | * @return bool |
||
44 | */ |
||
45 | public function view(User $user, Comment $comment) |
||
49 | |||
50 | /** |
||
51 | * Determine whether the user can create comments. |
||
52 | * |
||
53 | * @param User $user |
||
54 | * @param Project\Issue $issue |
||
55 | * |
||
56 | * @return bool |
||
57 | */ |
||
58 | public function create(User $user, Project\Issue $issue) |
||
62 | |||
63 | /** |
||
64 | * Determine whether the user can update the comment. |
||
65 | * |
||
66 | * @param User $user |
||
67 | * @param Comment $comment |
||
68 | * |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function update(User $user, Comment $comment) |
||
75 | |||
76 | /** |
||
77 | * Determine whether the user can delete the comment. |
||
78 | * |
||
79 | * @param User $user |
||
80 | * @param Comment $comment |
||
81 | * |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function delete(User $user, Comment $comment) |
||
88 | } |
||
89 |