1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-11 22:24:21 +01:00
fab-manager/app/policies/local_payment_policy.rb
Sylvain 66f81a975e WIP: array of items
Migration from cart_items:{reservation:{}, subscription:{}, ...}
to cart_items:{items:[{reservation:{}, ...}], ...}
2021-05-19 18:12:52 +02:00

9 lines
274 B
Ruby

# frozen_string_literal: true
# Check the access policies for API::LocalPaymentsController
class LocalPaymentPolicy < ApplicationPolicy
def confirm_payment?
user.admin? || (user.manager? && record.shopping_cart.customer.id != user.id) || record.price.zero?
end
end