CustomerFileTypePolicy   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 7
c 1
b 0
f 0
dl 0
loc 35
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A delete() 0 3 1
A update() 0 3 1
A view() 0 3 1
A create() 0 3 1
1
<?php
2
3
namespace App\Policies;
4
5
use App\Models\User;
6
use App\Traits\AllowTrait;
7
use Illuminate\Auth\Access\HandlesAuthorization;
8
9
class CustomerFileTypePolicy
10
{
11
    use AllowTrait;
12
    use HandlesAuthorization;
13
14
    /**
15
     * Determine whether the user can view the model
16
     */
17
    public function view(User $user)
18
    {
19
        return $this->checkPermission($user, 'Manage Customers');
20
    }
21
22
    /**
23
     * Determine whether the user can create models
24
     */
25
    public function create(User $user)
26
    {
27
        return $this->checkPermission($user, 'Manage Customers');
28
    }
29
30
    /**
31
     * Determine whether the user can update the model
32
     */
33
    public function update(User $user)
34
    {
35
        return $this->checkPermission($user, 'Manage Customers');
36
    }
37
38
    /**
39
     * Determine whether the user can delete the model
40
     */
41
    public function delete(User $user)
42
    {
43
        return $this->checkPermission($user, 'Manage Customers');
44
    }
45
}
46