can('inventory.view') || $user->can('inventory.update'); } /** * Determine whether the user can view the inventory transaction. */ public function view(User $user, InventoryTransaction $inventoryTransaction): bool { return $user->tenant_id === $inventoryTransaction->tenant_id && ($user->can('inventory.view') || $user->can('inventory.update')); } /** * Determine whether the user can create inventory transactions. */ public function create(User $user): bool { return $user->can('inventory.create'); } /** * Determine whether the user can update the inventory transaction. */ public function update(User $user, InventoryTransaction $inventoryTransaction): bool { return $user->tenant_id === $inventoryTransaction->tenant_id && $user->can('inventory.update'); } /** * Determine whether the user can delete the inventory transaction. */ public function delete(User $user, InventoryTransaction $inventoryTransaction): bool { return $user->tenant_id === $inventoryTransaction->tenant_id && $user->can('inventory.delete'); } }