Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function authorize() |
||
16 | { |
||
17 | $user = $this->user(); |
||
18 | if ($user === null) { |
||
19 | return false; |
||
20 | } |
||
21 | |||
22 | $inputIds = collect($this->all())->pluck('id')->all(); |
||
|
|||
23 | $applicationReviews = ApplicationReview::whereIn('id', $inputIds)->get(); |
||
24 | |||
25 | foreach ($applicationReviews as $applicationReview) { |
||
26 | if (!$user->can('update', $applicationReview)) { |
||
27 | return false; |
||
28 | } |
||
29 | } |
||
30 | return true; |
||
31 | } |
||
52 |