![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/rentpix.corals.io/Corals/modules/RentPix/Policies/ |
<?php namespace Corals\Modules\RentPix\Policies; use Corals\Foundation\Policies\BasePolicy; use Corals\Modules\RentPix\Models\Unit; use Corals\User\Models\User; class UnitPolicy extends BasePolicy { protected $administrationPermission = 'Administrations::admin.rentPix'; protected $skippedAbilities = ['create', 'update', 'destroy']; /** * @param User $user * @return bool */ public function view(User $user) { if ($user->can('RentPix::unit.view')) { return true; } return false; } /** * @param User $user * @return bool */ public function create(User $user) { // return $user->can('RentPix::unit.create'); return false; } /** * @param User $user * @param Unit $unit * @return bool */ public function update(User $user, Unit $unit) { // if ($user->can('RentPix::unit.update')) { // return true; // } return false; } /** * @param User $user * @param Unit $unit * @return bool */ public function destroy(User $user, Unit $unit) { if ($user->can('RentPix::unit.delete')) { return true; } return false; } }