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

25 lines
413 B
Ruby
Raw Normal View History

2020-04-28 16:49:05 +02:00
# frozen_string_literal: true
# Check the access policies for API::InvoicesController
2016-03-23 18:39:41 +01:00
class InvoicePolicy < ApplicationPolicy
def index?
user.admin?
2016-03-23 18:39:41 +01:00
end
def download?
2020-04-28 16:49:05 +02:00
user.admin? || user.manager? || (record.invoicing_profile.user_id == user.id)
2016-03-23 18:39:41 +01:00
end
def create?
2020-04-28 16:49:05 +02:00
user.admin? || user.manager?
2016-03-23 18:39:41 +01:00
end
def list?
user.admin? || user.manager?
end
2019-07-31 12:00:52 +02:00
def first?
user.admin?
end
2016-03-23 18:39:41 +01:00
end