1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/app/policies/availability_policy.rb

15 lines
337 B
Ruby
Raw Normal View History

# frozen_string_literal: true
# Check the access policies for API::AvailabilitiesController
2015-05-05 03:10:25 +02:00
class AvailabilityPolicy < ApplicationPolicy
%w[index? show? create? update? destroy? reservations? lock?].each do |action|
2015-05-05 03:10:25 +02:00
define_method action do
user.admin? || user.manager?
2015-05-05 03:10:25 +02:00
end
end
def export?
user.admin?
end
2015-05-05 03:10:25 +02:00
end