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
Sylvain 6a8746b110 [bug] updating a setting without any changes triggers an error
Also:
- Invoices interface for managers
- Refactoring of admin/invoices template: split into multiple files
2020-04-28 16:35:54 +02:00

22 lines
292 B
Ruby

class InvoicePolicy < ApplicationPolicy
def index?
user.admin?
end
def download?
user.admin? or (record.invoicing_profile.user_id == user.id)
end
def create?
user.admin?
end
def list?
user.admin? || user.manager?
end
def first?
user.admin?
end
end