Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

VendorPolicy.php 1.2KB

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