File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,9 @@ def may_delete_expense(self, expense):
195195 or expense .owner .user .username == self .user .username
196196 )
197197
198+ def may_edit_invoice (self ):
199+ return dauth .has_unscoped_permission ("edit-invoice" , self .user )
200+
198201 def may_delete_invoice (self , invoice ):
199202 if invoice .is_payed ():
200203 return False
Original file line number Diff line number Diff line change 66{% endblock %}
77
88{% block action %}
9- {% if user.username == invoice.owner.user.username or user.profile.firmatecknare %}
9+ {% if user.username == invoice.owner.user.username or user.profile.may_edit_invoice %}
1010 < a href ="{% url 'invoices-edit' invoice.id %} " class ="primary-action " style ="padding-top: 10px; padding-bottom: 8px; padding-left: 15px; padding-right: 15px; ">
1111 Redigera faktura
1212 </ a >
You can’t perform that action at this time.
0 commit comments