Passed
Push — develop ( a8f030...cce3fe )
by Francisco
02:56
created

ExchangePolicy::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Policies;
4
5
use App\Judite\Models\User;
6
use App\Judite\Models\Exchange;
7
use Illuminate\Auth\Access\HandlesAuthorization;
8
9
class ExchangePolicy
10
{
11
    use HandlesAuthorization;
12
13
    /**
14
     * Determine whether the user can make a decision on the given exchange.
15
     *
16
     * @param \App\Judite\Models\User     $user
17
     * @param \App\Judite\Models\Exchange $exchange
18
     *
19
     * @return bool
20
     */
21
    public function decide(User $user, Exchange $exchange)
22
    {
23
        return $user->id === $exchange->toEnrollment->student->user_id;
24
    }
25
}
26