1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-30 11:24:21 +01:00
fab-manager/app/policies/invoice_policy.rb
2020-04-28 16:49:05 +02:00

25 lines
413 B
Ruby

# frozen_string_literal: true
# Check the access policies for API::InvoicesController
class InvoicePolicy < ApplicationPolicy
def index?
user.admin?
end
def download?
user.admin? || user.manager? || (record.invoicing_profile.user_id == user.id)
end
def create?
user.admin? || user.manager?
end
def list?
user.admin? || user.manager?
end
def first?
user.admin?
end
end