1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-26 20:54:21 +01:00

[bug] Users with role 'member' cannot download their invoices

This commit is contained in:
Sylvain 2019-09-10 14:46:07 +02:00
parent 04f17d44d8
commit 5a75db394c
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
# Changelog Fab Manager # Changelog Fab Manager
- Fix a bug: Users with role 'member' cannot download their invoices
## v4.0.4 2019 August 14 ## v4.0.4 2019 August 14
- Fix a bug: #140 VAT rate is erronous in invoices. - Fix a bug: #140 VAT rate is erronous in invoices.
Note: this bug was introduced in v4.0.3 and requires (if you are on v4.0.3) to regenerate the invoices since August 1st (if Note: this bug was introduced in v4.0.3 and requires (if you are on v4.0.3) to regenerate the invoices since August 1st (if

View File

@ -4,7 +4,7 @@ class InvoicePolicy < ApplicationPolicy
end end
def download? def download?
user.admin? or (record.user_id == user.id) user.admin? or (record.invoicing_profile.user_id == user.id)
end end
def create? def create?