Issues (2963)

app/Policies/DeviceGroupPolicy.php (1 issue)

1
<?php
2
3
namespace App\Policies;
4
5
use App\Models\DeviceGroup;
6
use App\Models\User;
7
use Illuminate\Auth\Access\HandlesAuthorization;
8
9
class DeviceGroupPolicy
10
{
11
    use HandlesAuthorization;
12
13
    public function before($user, $ability)
14
    {
15
        if ($user->isAdmin()) {
16
            return true;
17
        }
18
    }
19
20
    /**
21
     * Determine whether the user can manage device groups.
22
     *
23
     * @param  \App\Models\User  $user
24
     * @return bool
25
     */
26
    public function manage(User $user)
27
    {
28
        return false;
29
    }
30
31
    /**
32
     * Determine whether the user can view the device group.
33
     *
34
     * @param  \App\Models\User  $user
35
     * @param  \App\Models\DeviceGroup  $deviceGroup
36
     * @return mixed
37
     */
38
    public function view(User $user, DeviceGroup $deviceGroup)
39
    {
40
        return false;
41
    }
42
43
    /**
44
     * Determine whether the user can view any device group.
45
     *
46
     * @param  \App\Models\User  $user
47
     * @return mixed
48
     */
49
    public function viewAny(User $user)
0 ignored issues
show
The parameter $user is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

49
    public function viewAny(/** @scrutinizer ignore-unused */ User $user)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
50
    {
51
        return false;
52
    }
53
54
    /**
55
     * Determine whether the user can create device groups.
56
     *
57
     * @param  \App\Models\User  $user
58
     * @return mixed
59
     */
60
    public function create(User $user)
61
    {
62
        return false;
63
    }
64
65
    /**
66
     * Determine whether the user can update the device group.
67
     *
68
     * @param  \App\Models\User  $user
69
     * @param  \App\Models\DeviceGroup  $deviceGroup
70
     * @return mixed
71
     */
72
    public function update(User $user, DeviceGroup $deviceGroup)
73
    {
74
        return false;
75
    }
76
77
    /**
78
     * Determine whether the user can delete the device group.
79
     *
80
     * @param  \App\Models\User  $user
81
     * @param  \App\Models\DeviceGroup  $deviceGroup
82
     * @return mixed
83
     */
84
    public function delete(User $user, DeviceGroup $deviceGroup)
85
    {
86
        return false;
87
    }
88
89
    /**
90
     * Determine whether the user can restore the device group.
91
     *
92
     * @param  \App\Models\User  $user
93
     * @param  \App\Models\DeviceGroup  $deviceGroup
94
     * @return mixed
95
     */
96
    public function restore(User $user, DeviceGroup $deviceGroup)
97
    {
98
        return false;
99
    }
100
101
    /**
102
     * Determine whether the user can permanently delete the device group.
103
     *
104
     * @param  \App\Models\User  $user
105
     * @param  \App\Models\DeviceGroup  $deviceGroup
106
     * @return mixed
107
     */
108
    public function forceDelete(User $user, DeviceGroup $deviceGroup)
109
    {
110
        return false;
111
    }
112
}
113