1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00
fab-manager/app/policies/payment_schedule_policy.rb
Sylvain effe5c7ba9 optimized the load time of the payment schedules list
From now, we no longer retrieve the client_secret directly from the API/list but from a specialized component which ask API/get_item.
This highly decrease the laod time needed to fetch API/list
2022-01-03 11:24:08 +01:00

17 lines
468 B
Ruby

# frozen_string_literal: true
# Check the access policies for API::PaymentSchedulesController
class PaymentSchedulePolicy < ApplicationPolicy
%w[list? cash_check? cancel?].each do |action|
define_method action do
user.admin? || user.manager?
end
end
%w[refresh_item? download? pay_item? show_item?].each do |action|
define_method action do
user.admin? || user.manager? || (record.invoicing_profile.user_id == user.id)
end
end
end