1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-12 23:09:03 +01:00
fab-manager/app/policies/reservation_policy.rb

17 lines
385 B
Ruby
Raw Normal View History

# frozen_string_literal: true
# Check the access policies for API::ReservationsController
2016-03-23 18:39:41 +01:00
class ReservationPolicy < ApplicationPolicy
2019-09-09 17:37:54 +02:00
def create?
user.admin? || (user.manager? && record.user_id != user.id) || record.price.zero?
2019-09-09 17:37:54 +02:00
end
2016-03-23 18:39:41 +01:00
def update?
user.admin? || user.manager? || record.user == user
2016-03-23 18:39:41 +01:00
end
def confirm_payment?
user.admin? || user.manager?
end
2016-03-23 18:39:41 +01:00
end