mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-18 07:52:23 +01:00
effe5c7ba9
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
17 lines
468 B
Ruby
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
|