1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/policies/accounting_period_policy.rb

15 lines
337 B
Ruby
Raw Normal View History

# frozen_string_literal: true
# Check the access policies for API::AccountingPeriodsController
class AccountingPeriodPolicy < ApplicationPolicy
2020-04-28 16:49:05 +02:00
%w[index show create download_archive].each do |action|
define_method "#{action}?" do
2019-01-14 14:32:00 +01:00
user.admin?
end
end
2020-04-28 16:49:05 +02:00
def last_closing_end?
user.admin? || user.manager?
end
end