35 lines
661 B
PHP
35 lines
661 B
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\IpPool;
|
|
use App\Models\User;
|
|
|
|
class IpPoolPolicy
|
|
{
|
|
public function viewAny(User $user): bool
|
|
{
|
|
return $user->is_active;
|
|
}
|
|
|
|
public function view(User $user, IpPool $ipPool): bool
|
|
{
|
|
return $user->is_active;
|
|
}
|
|
|
|
public function create(User $user): bool
|
|
{
|
|
return $user->isAdmin() && $user->is_active;
|
|
}
|
|
|
|
public function update(User $user, IpPool $ipPool): bool
|
|
{
|
|
return $user->isAdmin() && $user->is_active;
|
|
}
|
|
|
|
public function delete(User $user, IpPool $ipPool): bool
|
|
{
|
|
return $user->isAdmin() && $user->is_active;
|
|
}
|
|
}
|