Added policy files

This commit is contained in:
dhanabalan
2025-07-02 18:07:09 +05:30
parent cd09b912ee
commit f5345fc2b8
8 changed files with 848 additions and 0 deletions

View File

@@ -0,0 +1,106 @@
<?php
namespace App\Policies;
use Illuminate\Auth\Access\Response;
use App\Models\Configuration;
use App\Models\User;
class ConfigurationPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->checkPermissionTo('view-any Configuration');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Configuration $configuration): bool
{
return $user->checkPermissionTo('view Configuration');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->checkPermissionTo('create Configuration');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Configuration $configuration): bool
{
return $user->checkPermissionTo('update Configuration');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Configuration $configuration): bool
{
return $user->checkPermissionTo('delete Configuration');
}
/**
* Determine whether the user can delete any models.
*/
public function deleteAny(User $user): bool
{
return $user->checkPermissionTo('delete-any Configuration');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Configuration $configuration): bool
{
return $user->checkPermissionTo('restore Configuration');
}
/**
* Determine whether the user can restore any models.
*/
public function restoreAny(User $user): bool
{
return $user->checkPermissionTo('restore-any Configuration');
}
/**
* Determine whether the user can replicate the model.
*/
public function replicate(User $user, Configuration $configuration): bool
{
return $user->checkPermissionTo('replicate Configuration');
}
/**
* Determine whether the user can reorder the models.
*/
public function reorder(User $user): bool
{
return $user->checkPermissionTo('reorder Configuration');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Configuration $configuration): bool
{
return $user->checkPermissionTo('force-delete Configuration');
}
/**
* Determine whether the user can permanently delete any models.
*/
public function forceDeleteAny(User $user): bool
{
return $user->checkPermissionTo('force-delete-any Configuration');
}
}

View File

@@ -0,0 +1,106 @@
<?php
namespace App\Policies;
use Illuminate\Auth\Access\Response;
use App\Models\LocatorInvoiceValidation;
use App\Models\User;
class LocatorInvoiceValidationPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->checkPermissionTo('view-any LocatorInvoiceValidation');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, LocatorInvoiceValidation $locatorinvoicevalidation): bool
{
return $user->checkPermissionTo('view LocatorInvoiceValidation');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->checkPermissionTo('create LocatorInvoiceValidation');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, LocatorInvoiceValidation $locatorinvoicevalidation): bool
{
return $user->checkPermissionTo('update LocatorInvoiceValidation');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, LocatorInvoiceValidation $locatorinvoicevalidation): bool
{
return $user->checkPermissionTo('delete LocatorInvoiceValidation');
}
/**
* Determine whether the user can delete any models.
*/
public function deleteAny(User $user): bool
{
return $user->checkPermissionTo('delete-any LocatorInvoiceValidation');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, LocatorInvoiceValidation $locatorinvoicevalidation): bool
{
return $user->checkPermissionTo('restore LocatorInvoiceValidation');
}
/**
* Determine whether the user can restore any models.
*/
public function restoreAny(User $user): bool
{
return $user->checkPermissionTo('restore-any LocatorInvoiceValidation');
}
/**
* Determine whether the user can replicate the model.
*/
public function replicate(User $user, LocatorInvoiceValidation $locatorinvoicevalidation): bool
{
return $user->checkPermissionTo('replicate LocatorInvoiceValidation');
}
/**
* Determine whether the user can reorder the models.
*/
public function reorder(User $user): bool
{
return $user->checkPermissionTo('reorder LocatorInvoiceValidation');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, LocatorInvoiceValidation $locatorinvoicevalidation): bool
{
return $user->checkPermissionTo('force-delete LocatorInvoiceValidation');
}
/**
* Determine whether the user can permanently delete any models.
*/
public function forceDeleteAny(User $user): bool
{
return $user->checkPermissionTo('force-delete-any LocatorInvoiceValidation');
}
}

View File

@@ -0,0 +1,106 @@
<?php
namespace App\Policies;
use Illuminate\Auth\Access\Response;
use App\Models\Locator;
use App\Models\User;
class LocatorPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->checkPermissionTo('view-any Locator');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Locator $locator): bool
{
return $user->checkPermissionTo('view Locator');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->checkPermissionTo('create Locator');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Locator $locator): bool
{
return $user->checkPermissionTo('update Locator');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Locator $locator): bool
{
return $user->checkPermissionTo('delete Locator');
}
/**
* Determine whether the user can delete any models.
*/
public function deleteAny(User $user): bool
{
return $user->checkPermissionTo('delete-any Locator');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Locator $locator): bool
{
return $user->checkPermissionTo('restore Locator');
}
/**
* Determine whether the user can restore any models.
*/
public function restoreAny(User $user): bool
{
return $user->checkPermissionTo('restore-any Locator');
}
/**
* Determine whether the user can replicate the model.
*/
public function replicate(User $user, Locator $locator): bool
{
return $user->checkPermissionTo('replicate Locator');
}
/**
* Determine whether the user can reorder the models.
*/
public function reorder(User $user): bool
{
return $user->checkPermissionTo('reorder Locator');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Locator $locator): bool
{
return $user->checkPermissionTo('force-delete Locator');
}
/**
* Determine whether the user can permanently delete any models.
*/
public function forceDeleteAny(User $user): bool
{
return $user->checkPermissionTo('force-delete-any Locator');
}
}

View File

@@ -0,0 +1,106 @@
<?php
namespace App\Policies;
use Illuminate\Auth\Access\Response;
use App\Models\Machine;
use App\Models\User;
class MachinePolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->checkPermissionTo('view-any Machine');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Machine $machine): bool
{
return $user->checkPermissionTo('view Machine');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->checkPermissionTo('create Machine');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Machine $machine): bool
{
return $user->checkPermissionTo('update Machine');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Machine $machine): bool
{
return $user->checkPermissionTo('delete Machine');
}
/**
* Determine whether the user can delete any models.
*/
public function deleteAny(User $user): bool
{
return $user->checkPermissionTo('delete-any Machine');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Machine $machine): bool
{
return $user->checkPermissionTo('restore Machine');
}
/**
* Determine whether the user can restore any models.
*/
public function restoreAny(User $user): bool
{
return $user->checkPermissionTo('restore-any Machine');
}
/**
* Determine whether the user can replicate the model.
*/
public function replicate(User $user, Machine $machine): bool
{
return $user->checkPermissionTo('replicate Machine');
}
/**
* Determine whether the user can reorder the models.
*/
public function reorder(User $user): bool
{
return $user->checkPermissionTo('reorder Machine');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Machine $machine): bool
{
return $user->checkPermissionTo('force-delete Machine');
}
/**
* Determine whether the user can permanently delete any models.
*/
public function forceDeleteAny(User $user): bool
{
return $user->checkPermissionTo('force-delete-any Machine');
}
}

View File

@@ -0,0 +1,106 @@
<?php
namespace App\Policies;
use Illuminate\Auth\Access\Response;
use App\Models\MotorTestingMaster;
use App\Models\User;
class MotorTestingMasterPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->checkPermissionTo('view-any MotorTestingMaster');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, MotorTestingMaster $motortestingmaster): bool
{
return $user->checkPermissionTo('view MotorTestingMaster');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->checkPermissionTo('create MotorTestingMaster');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, MotorTestingMaster $motortestingmaster): bool
{
return $user->checkPermissionTo('update MotorTestingMaster');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, MotorTestingMaster $motortestingmaster): bool
{
return $user->checkPermissionTo('delete MotorTestingMaster');
}
/**
* Determine whether the user can delete any models.
*/
public function deleteAny(User $user): bool
{
return $user->checkPermissionTo('delete-any MotorTestingMaster');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, MotorTestingMaster $motortestingmaster): bool
{
return $user->checkPermissionTo('restore MotorTestingMaster');
}
/**
* Determine whether the user can restore any models.
*/
public function restoreAny(User $user): bool
{
return $user->checkPermissionTo('restore-any MotorTestingMaster');
}
/**
* Determine whether the user can replicate the model.
*/
public function replicate(User $user, MotorTestingMaster $motortestingmaster): bool
{
return $user->checkPermissionTo('replicate MotorTestingMaster');
}
/**
* Determine whether the user can reorder the models.
*/
public function reorder(User $user): bool
{
return $user->checkPermissionTo('reorder MotorTestingMaster');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, MotorTestingMaster $motortestingmaster): bool
{
return $user->checkPermissionTo('force-delete MotorTestingMaster');
}
/**
* Determine whether the user can permanently delete any models.
*/
public function forceDeleteAny(User $user): bool
{
return $user->checkPermissionTo('force-delete-any MotorTestingMaster');
}
}

View File

@@ -0,0 +1,106 @@
<?php
namespace App\Policies;
use Illuminate\Auth\Access\Response;
use App\Models\PalletValidation;
use App\Models\User;
class PalletValidationPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->checkPermissionTo('view-any PalletValidation');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, PalletValidation $palletvalidation): bool
{
return $user->checkPermissionTo('view PalletValidation');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->checkPermissionTo('create PalletValidation');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, PalletValidation $palletvalidation): bool
{
return $user->checkPermissionTo('update PalletValidation');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, PalletValidation $palletvalidation): bool
{
return $user->checkPermissionTo('delete PalletValidation');
}
/**
* Determine whether the user can delete any models.
*/
public function deleteAny(User $user): bool
{
return $user->checkPermissionTo('delete-any PalletValidation');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, PalletValidation $palletvalidation): bool
{
return $user->checkPermissionTo('restore PalletValidation');
}
/**
* Determine whether the user can restore any models.
*/
public function restoreAny(User $user): bool
{
return $user->checkPermissionTo('restore-any PalletValidation');
}
/**
* Determine whether the user can replicate the model.
*/
public function replicate(User $user, PalletValidation $palletvalidation): bool
{
return $user->checkPermissionTo('replicate PalletValidation');
}
/**
* Determine whether the user can reorder the models.
*/
public function reorder(User $user): bool
{
return $user->checkPermissionTo('reorder PalletValidation');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, PalletValidation $palletvalidation): bool
{
return $user->checkPermissionTo('force-delete PalletValidation');
}
/**
* Determine whether the user can permanently delete any models.
*/
public function forceDeleteAny(User $user): bool
{
return $user->checkPermissionTo('force-delete-any PalletValidation');
}
}

View File

@@ -0,0 +1,106 @@
<?php
namespace App\Policies;
use Illuminate\Auth\Access\Response;
use App\Models\ReworkLocatorInvoiceValidation;
use App\Models\User;
class ReworkLocatorInvoiceValidationPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->checkPermissionTo('view-any ReworkLocatorInvoiceValidation');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, ReworkLocatorInvoiceValidation $reworklocatorinvoicevalidation): bool
{
return $user->checkPermissionTo('view ReworkLocatorInvoiceValidation');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->checkPermissionTo('create ReworkLocatorInvoiceValidation');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, ReworkLocatorInvoiceValidation $reworklocatorinvoicevalidation): bool
{
return $user->checkPermissionTo('update ReworkLocatorInvoiceValidation');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, ReworkLocatorInvoiceValidation $reworklocatorinvoicevalidation): bool
{
return $user->checkPermissionTo('delete ReworkLocatorInvoiceValidation');
}
/**
* Determine whether the user can delete any models.
*/
public function deleteAny(User $user): bool
{
return $user->checkPermissionTo('delete-any ReworkLocatorInvoiceValidation');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, ReworkLocatorInvoiceValidation $reworklocatorinvoicevalidation): bool
{
return $user->checkPermissionTo('restore ReworkLocatorInvoiceValidation');
}
/**
* Determine whether the user can restore any models.
*/
public function restoreAny(User $user): bool
{
return $user->checkPermissionTo('restore-any ReworkLocatorInvoiceValidation');
}
/**
* Determine whether the user can replicate the model.
*/
public function replicate(User $user, ReworkLocatorInvoiceValidation $reworklocatorinvoicevalidation): bool
{
return $user->checkPermissionTo('replicate ReworkLocatorInvoiceValidation');
}
/**
* Determine whether the user can reorder the models.
*/
public function reorder(User $user): bool
{
return $user->checkPermissionTo('reorder ReworkLocatorInvoiceValidation');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, ReworkLocatorInvoiceValidation $reworklocatorinvoicevalidation): bool
{
return $user->checkPermissionTo('force-delete ReworkLocatorInvoiceValidation');
}
/**
* Determine whether the user can permanently delete any models.
*/
public function forceDeleteAny(User $user): bool
{
return $user->checkPermissionTo('force-delete-any ReworkLocatorInvoiceValidation');
}
}

View File

@@ -0,0 +1,106 @@
<?php
namespace App\Policies;
use Illuminate\Auth\Access\Response;
use App\Models\TestingPanelReading;
use App\Models\User;
class TestingPanelReadingPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->checkPermissionTo('view-any TestingPanelReading');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, TestingPanelReading $testingpanelreading): bool
{
return $user->checkPermissionTo('view TestingPanelReading');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->checkPermissionTo('create TestingPanelReading');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, TestingPanelReading $testingpanelreading): bool
{
return $user->checkPermissionTo('update TestingPanelReading');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, TestingPanelReading $testingpanelreading): bool
{
return $user->checkPermissionTo('delete TestingPanelReading');
}
/**
* Determine whether the user can delete any models.
*/
public function deleteAny(User $user): bool
{
return $user->checkPermissionTo('delete-any TestingPanelReading');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, TestingPanelReading $testingpanelreading): bool
{
return $user->checkPermissionTo('restore TestingPanelReading');
}
/**
* Determine whether the user can restore any models.
*/
public function restoreAny(User $user): bool
{
return $user->checkPermissionTo('restore-any TestingPanelReading');
}
/**
* Determine whether the user can replicate the model.
*/
public function replicate(User $user, TestingPanelReading $testingpanelreading): bool
{
return $user->checkPermissionTo('replicate TestingPanelReading');
}
/**
* Determine whether the user can reorder the models.
*/
public function reorder(User $user): bool
{
return $user->checkPermissionTo('reorder TestingPanelReading');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, TestingPanelReading $testingpanelreading): bool
{
return $user->checkPermissionTo('force-delete TestingPanelReading');
}
/**
* Determine whether the user can permanently delete any models.
*/
public function forceDeleteAny(User $user): bool
{
return $user->checkPermissionTo('force-delete-any TestingPanelReading');
}
}