mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
6a8746b110
Also: - Invoices interface for managers - Refactoring of admin/invoices template: split into multiple files
22 lines
292 B
Ruby
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
|