Files
librenms-librenms/app/Policies/DeviceGroupPolicy.php
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

105 lines
2.3 KiB
PHP
Raw Normal View History

2019-06-19 16:01:53 -05:00
<?php
namespace App\Policies;
use App\Models\DeviceGroup;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
class DeviceGroupPolicy
{
use HandlesAuthorization;
public function before($user, $ability)
{
if ($user->isAdmin()) {
return true;
}
}
/**
* Determine whether the user can manage device groups.
*
2021-09-08 23:35:56 +02:00
* @param \App\Models\User $user
2019-06-19 16:01:53 -05:00
*/
2023-05-24 22:21:54 +02:00
public function manage(User $user): bool
2019-06-19 16:01:53 -05:00
{
return false;
}
/**
* Determine whether the user can view the device group.
*
2021-09-08 23:35:56 +02:00
* @param \App\Models\User $user
* @param \App\Models\DeviceGroup $deviceGroup
2019-06-19 16:01:53 -05:00
*/
2023-05-24 22:21:54 +02:00
public function view(User $user, DeviceGroup $deviceGroup): bool
2019-06-19 16:01:53 -05:00
{
return false;
}
2020-05-23 19:05:18 +02:00
/**
* Determine whether the user can view any device group.
*
2021-09-08 23:35:56 +02:00
* @param \App\Models\User $user
2020-05-23 19:05:18 +02:00
*/
2023-05-24 22:21:54 +02:00
public function viewAny(User $user): bool
2020-05-23 19:05:18 +02:00
{
return false;
}
2019-06-19 16:01:53 -05:00
/**
* Determine whether the user can create device groups.
*
2021-09-08 23:35:56 +02:00
* @param \App\Models\User $user
2019-06-19 16:01:53 -05:00
*/
2023-05-24 22:21:54 +02:00
public function create(User $user): bool
2019-06-19 16:01:53 -05:00
{
return false;
}
/**
* Determine whether the user can update the device group.
*
2021-09-08 23:35:56 +02:00
* @param \App\Models\User $user
* @param \App\Models\DeviceGroup $deviceGroup
2019-06-19 16:01:53 -05:00
*/
2023-05-24 22:21:54 +02:00
public function update(User $user, DeviceGroup $deviceGroup): bool
2019-06-19 16:01:53 -05:00
{
return false;
}
/**
* Determine whether the user can delete the device group.
*
2021-09-08 23:35:56 +02:00
* @param \App\Models\User $user
* @param \App\Models\DeviceGroup $deviceGroup
2019-06-19 16:01:53 -05:00
*/
2023-05-24 22:21:54 +02:00
public function delete(User $user, DeviceGroup $deviceGroup): bool
2019-06-19 16:01:53 -05:00
{
return false;
}
/**
* Determine whether the user can restore the device group.
*
2021-09-08 23:35:56 +02:00
* @param \App\Models\User $user
* @param \App\Models\DeviceGroup $deviceGroup
2019-06-19 16:01:53 -05:00
*/
2023-05-24 22:21:54 +02:00
public function restore(User $user, DeviceGroup $deviceGroup): bool
2019-06-19 16:01:53 -05:00
{
return false;
}
/**
* Determine whether the user can permanently delete the device group.
*
2021-09-08 23:35:56 +02:00
* @param \App\Models\User $user
* @param \App\Models\DeviceGroup $deviceGroup
2019-06-19 16:01:53 -05:00
*/
2023-05-24 22:21:54 +02:00
public function forceDelete(User $user, DeviceGroup $deviceGroup): bool
2019-06-19 16:01:53 -05:00
{
return false;
}
}