From f5345fc2b86fda8471cce4d7ea5a1a94f04d26d8 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 2 Jul 2025 18:07:09 +0530 Subject: [PATCH] Added policy files --- app/Policies/ConfigurationPolicy.php | 106 ++++++++++++++++++ .../LocatorInvoiceValidationPolicy.php | 106 ++++++++++++++++++ app/Policies/LocatorPolicy.php | 106 ++++++++++++++++++ app/Policies/MachinePolicy.php | 106 ++++++++++++++++++ app/Policies/MotorTestingMasterPolicy.php | 106 ++++++++++++++++++ app/Policies/PalletValidationPolicy.php | 106 ++++++++++++++++++ .../ReworkLocatorInvoiceValidationPolicy.php | 106 ++++++++++++++++++ app/Policies/TestingPanelReadingPolicy.php | 106 ++++++++++++++++++ 8 files changed, 848 insertions(+) create mode 100644 app/Policies/ConfigurationPolicy.php create mode 100644 app/Policies/LocatorInvoiceValidationPolicy.php create mode 100644 app/Policies/LocatorPolicy.php create mode 100644 app/Policies/MachinePolicy.php create mode 100644 app/Policies/MotorTestingMasterPolicy.php create mode 100644 app/Policies/PalletValidationPolicy.php create mode 100644 app/Policies/ReworkLocatorInvoiceValidationPolicy.php create mode 100644 app/Policies/TestingPanelReadingPolicy.php diff --git a/app/Policies/ConfigurationPolicy.php b/app/Policies/ConfigurationPolicy.php new file mode 100644 index 000000000..6d65f7be6 --- /dev/null +++ b/app/Policies/ConfigurationPolicy.php @@ -0,0 +1,106 @@ +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'); + } +} diff --git a/app/Policies/LocatorInvoiceValidationPolicy.php b/app/Policies/LocatorInvoiceValidationPolicy.php new file mode 100644 index 000000000..ff3b963d1 --- /dev/null +++ b/app/Policies/LocatorInvoiceValidationPolicy.php @@ -0,0 +1,106 @@ +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'); + } +} diff --git a/app/Policies/LocatorPolicy.php b/app/Policies/LocatorPolicy.php new file mode 100644 index 000000000..5ab7d3301 --- /dev/null +++ b/app/Policies/LocatorPolicy.php @@ -0,0 +1,106 @@ +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'); + } +} diff --git a/app/Policies/MachinePolicy.php b/app/Policies/MachinePolicy.php new file mode 100644 index 000000000..6c0e54d0a --- /dev/null +++ b/app/Policies/MachinePolicy.php @@ -0,0 +1,106 @@ +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'); + } +} diff --git a/app/Policies/MotorTestingMasterPolicy.php b/app/Policies/MotorTestingMasterPolicy.php new file mode 100644 index 000000000..f8253e319 --- /dev/null +++ b/app/Policies/MotorTestingMasterPolicy.php @@ -0,0 +1,106 @@ +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'); + } +} diff --git a/app/Policies/PalletValidationPolicy.php b/app/Policies/PalletValidationPolicy.php new file mode 100644 index 000000000..5ff8748c0 --- /dev/null +++ b/app/Policies/PalletValidationPolicy.php @@ -0,0 +1,106 @@ +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'); + } +} diff --git a/app/Policies/ReworkLocatorInvoiceValidationPolicy.php b/app/Policies/ReworkLocatorInvoiceValidationPolicy.php new file mode 100644 index 000000000..7ef7f6647 --- /dev/null +++ b/app/Policies/ReworkLocatorInvoiceValidationPolicy.php @@ -0,0 +1,106 @@ +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'); + } +} diff --git a/app/Policies/TestingPanelReadingPolicy.php b/app/Policies/TestingPanelReadingPolicy.php new file mode 100644 index 000000000..7eb23c7a5 --- /dev/null +++ b/app/Policies/TestingPanelReadingPolicy.php @@ -0,0 +1,106 @@ +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'); + } +}