You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
791 B
37 lines
791 B
<?php
|
|
|
|
namespace App\Domains\Billing\Policies;
|
|
|
|
use App\Domains\Billing\Models\Product;
|
|
use App\Domains\Identity\Models\User;
|
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
|
|
|
class ProductPolicy
|
|
{
|
|
use HandlesAuthorization;
|
|
|
|
public function viewAny(User $user): bool
|
|
{
|
|
return $user->can('product.viewAny');
|
|
}
|
|
|
|
public function view(User $user, Product $model): bool
|
|
{
|
|
return $user->can('product.view');
|
|
}
|
|
|
|
public function create(User $user): bool
|
|
{
|
|
return $user->can('product.create');
|
|
}
|
|
|
|
public function update(User $user, Product $model): bool
|
|
{
|
|
return $user->can('product.update');
|
|
}
|
|
|
|
public function delete(User $user, Product $model): bool
|
|
{
|
|
return $user->can('product.delete');
|
|
}
|
|
}
|
|
|