| 1 | <?php |
||
| 19 | class NotePolicy |
||
| 20 | { |
||
| 21 | use HandlesAuthorization, ProjectAccess; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param User $user |
||
| 25 | * |
||
| 26 | * @return bool |
||
| 27 | */ |
||
| 28 | public function before(User $user) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Determine whether the user can view the note. |
||
| 37 | * |
||
| 38 | * @param User $user |
||
| 39 | * @param Project $project |
||
| 40 | * |
||
| 41 | * @return bool |
||
| 42 | */ |
||
| 43 | public function view(User $user, Project $project) |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Determine whether the user can create notes. |
||
| 54 | * |
||
| 55 | * @param User $user |
||
| 56 | * |
||
| 57 | * @return bool |
||
| 58 | */ |
||
| 59 | public function create(User $user) |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Determine whether the user can update the note. |
||
| 66 | * |
||
| 67 | * @param User $user |
||
| 68 | * |
||
| 69 | * @return bool |
||
| 70 | */ |
||
| 71 | public function update(User $user) |
||
| 75 | |||
| 76 | /** |
||
| 77 | * Determine whether the user can delete the note. |
||
| 78 | * |
||
| 79 | * @param User $user |
||
| 80 | * |
||
| 81 | * @return bool |
||
| 82 | */ |
||
| 83 | public function delete(User $user) |
||
| 87 | } |
||
| 88 |