UserRolesPolicy::view()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Policies;
4
5
use App\Models\User;
6
use App\Models\UserRoles;
7
use App\Traits\AllowTrait;
8
use Illuminate\Auth\Access\HandlesAuthorization;
9
10
class UserRolesPolicy
11
{
12
    use AllowTrait;
13
    use HandlesAuthorization;
14
15
    /**
16
     * Determine whether the user can view any models
17
     */
18
    public function viewAny(User $user)
19
    {
20
        return $this->checkPermission($user, 'Manage Permissions');
21
    }
22
23
    /**
24
     * Determine whether the user can view the model
25
     */
26
    public function view(User $user)
27
    {
28
        return $this->checkPermission($user, 'Manage Permissions');
29
    }
30
31
    /**
32
     * Determine whether the user can create models
33
     */
34
    public function create(User $user)
35
    {
36
        return $this->checkPermission($user, 'Manage Permissions');
37
    }
38
39
    /**
40
     * Determine whether the user can update the model
41
     */
42
    public function update(User $user)
43
    {
44
        return $this->checkPermission($user, 'Manage Permissions');
45
    }
46
47
    /**
48
     * Determine whether the user can delete the model
49
     */
50
    public function delete(User $user)
51
    {
52
        return $this->checkPermission($user, 'Manage Permissions');
53
    }
54
55
    /**
56
     * Determine whether the user can restore the model
57
     */
58
    public function restore(User $user)
59
    {
60
        return $this->checkPermission($user, 'Manage Permissions');
61
    }
62
63
    /**
64
     * Determine whether the user can permanently delete the model
65
     */
66
    public function forceDelete(User $user)
67
    {
68
        return $this->checkPermission($user, 'Manage Permissions');
69
    }
70
}
71