1 | <?php |
||
11 | class AttachmentPolicy |
||
12 | { |
||
13 | use HandlesAuthorization; |
||
14 | |||
15 | /** |
||
16 | * @param User $user |
||
17 | * |
||
18 | * @return bool |
||
19 | */ |
||
20 | public function before(User $user) |
||
26 | |||
27 | /** |
||
28 | * Determine whether the user can view the attachment. |
||
29 | * |
||
30 | * @param User $user |
||
31 | * @param Attachment $attachment |
||
32 | * @param Project\Issue $issue |
||
33 | * @param Project $project |
||
34 | * |
||
35 | * @return bool |
||
36 | */ |
||
37 | public function view(User $user, Attachment $attachment, Project\Issue $issue, Project $project) |
||
41 | |||
42 | /** |
||
43 | * Determine whether the user can create attachments. |
||
44 | * |
||
45 | * @param User $user |
||
46 | * @param Project $project |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function create(User $user, Project $project) |
||
54 | |||
55 | /** |
||
56 | * Determine whether the user can update the attachment. |
||
57 | * |
||
58 | * @param User $user |
||
59 | * @param Attachment $attachment |
||
60 | * @param Project\Issue $issue |
||
61 | * @param Project $project |
||
62 | * |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function update(User $user, Attachment $attachment, Project\Issue $issue, Project $project) |
||
74 | |||
75 | /** |
||
76 | * Determine whether the user can delete the attachment. |
||
77 | * |
||
78 | * @param User $user |
||
79 | * @param Attachment $attachment |
||
80 | * @param Project\Issue $issue |
||
81 | * @param Project $project |
||
82 | * |
||
83 | * @return bool |
||
84 | */ |
||
85 | public function delete(User $user, Attachment $attachment, Project\Issue $issue, Project $project) |
||
89 | } |
||
90 |