Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

BankAccountPolicy.php 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace App\Policies;
  3. use App\Models\Banking\BankAccount;
  4. use App\Models\User;
  5. use Illuminate\Auth\Access\HandlesAuthorization;
  6. class BankAccountPolicy
  7. {
  8. use HandlesAuthorization;
  9. /**
  10. * Determine whether the user can view any models.
  11. */
  12. public function viewAny(User $user): bool
  13. {
  14. return true;
  15. }
  16. /**
  17. * Determine whether the user can view the model.
  18. */
  19. public function view(User $user, BankAccount $bankAccount): bool
  20. {
  21. return true;
  22. }
  23. /**
  24. * Determine whether the user can create models.
  25. */
  26. public function create(User $user): bool
  27. {
  28. return true;
  29. }
  30. /**
  31. * Determine whether the user can update the model.
  32. */
  33. public function update(User $user, BankAccount $bankAccount): bool
  34. {
  35. return true;
  36. }
  37. /**
  38. * Determine whether the user can delete the model.
  39. */
  40. public function delete(User $user, BankAccount $bankAccount): bool
  41. {
  42. return $bankAccount->isDisabled();
  43. }
  44. public function deleteAny(User $user): bool
  45. {
  46. return true;
  47. }
  48. /**
  49. * Determine whether the user can restore the model.
  50. */
  51. public function restore(User $user, BankAccount $bankAccount): bool
  52. {
  53. return false;
  54. }
  55. /**
  56. * Determine whether the user can permanently delete the model.
  57. */
  58. public function forceDelete(User $user, BankAccount $bankAccount): bool
  59. {
  60. return false;
  61. }
  62. }