module Payments
  class PurchaseOrderPolicy < ApplicationPolicy
    def index?
      allowed?
    end

    def show?
      allowed?
    end

    def cancel?
      allowed?
    end

    def do_not_renew?
      allowed?
    end

    def label_fraud?
      allowed?
    end

    def refund_fraud?
      allowed?
    end

    def mark_refunded_by_finance?
      allowed?
    end

    def refund?
      allowed?
    end

    def allowed?
      user.permitted? BeefCake::Permission.for(:purchase_orders)
    end
  end
end
