UserPolicy   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A update() 0 4 2
A delete() 0 4 2
1
<?php
2
3
namespace Gamer\Policies;
4
5
use Illuminate\Auth\Access\HandlesAuthorization;
6
use App\Models\User;
7
8
class UserPolicy
9
{
10
    use HandlesAuthorization;
11
12
    public function update(User $currentUser, User $user)
13
    {
14
        return $currentUser->may('manage_users') || $currentUser->id == $user->id;
15
    }
16
17
    public function delete(User $currentUser, User $user)
18
    {
19
        return $currentUser->may('manage_users') || $currentUser->id == $user->id;
20
    }
21
}
22