purityselect/app/Policies/ProductsPolicy.php
2024-10-25 01:05:27 +05:00

43 lines
907 B
PHP

<?php
namespace App\Policies;
use App\Permissions\Modules\Admin;
use App\Permissions\Modules\Prescription;
use App\Permissions\Modules\Products;
// use App\Models\Admin Admins;
use Illuminate\Auth\Access\HandlesAuthorization;
class ProductsPolicy
{
use HandlesAuthorization;
private $class_name='PlanV1';
/**
* Create a new policy instance.
*
* @return void
*/
public function __construct()
{
//
}
public function add($user)
{
return $user->role->havePermission(Products::PRODUCT_ADD);
}
public function edit($user)
{
return $user->role->havePermission(Products::PRODUCT_EDIT);
}
public function delete($user)
{
return $user->role->havePermission(Products::PRODUCT_DELETE);
}
public function list($user)
{
return $user->role->havePermission(Products::PRODUCT_VIEW);
}
}