Commit 13f5bb1c authored by Matthieu Fesselier's avatar Matthieu Fesselier

update: add permissions

parent 23f168ba
Pipeline #4722 passed with stage
in 27 seconds
......@@ -40,6 +40,9 @@ class FreelanceInvoice(Model):
('control_freelance_invoice', 'Control'),
)
rdf_type = 'hd:freelanceinvoice'
anonymous_perms = ['view']
authenticated_perms = ['inherit', 'add']
owner_perms = ['inherit', 'change', 'control', 'delete']
def __str__(self):
return '{} ({} / {})'.format(self.freelanceFullname, self.identifier, self.title)
......@@ -85,6 +88,9 @@ class CustomerInvoice(Model):
('control_invoice', 'Control'),
)
rdf_type = 'hd:customerinvoice'
anonymous_perms = ['view']
authenticated_perms = ['inherit', 'add']
owner_perms = ['inherit', 'change', 'control', 'delete']
def __str__(self):
return '{} - {} ({})'.format(self.identifier, self.title, self.htAmount())
......@@ -104,6 +110,9 @@ class Batch(Model):
('view_batch', 'Read'),
('control_batch', 'Control'),
)
anonymous_perms = ['view']
authenticated_perms = ['inherit', 'add']
owner_perms = ['inherit', 'change', 'control', 'delete']
def __str__(self):
return '{} - {} ({} € HT)'.format(self.invoice.title, self.title, self.htAmount())
......@@ -122,5 +131,10 @@ class Task(Model):
creationDate = models.DateField(auto_now_add=True)
modificationDate = models.DateField(auto_now=True)
class Meta:
anonymous_perms = ['view']
authenticated_perms = ['inherit', 'add']
owner_perms = ['inherit', 'change', 'control', 'delete']
def __str__(self):
return '{} - {} ({} € HT)'.format(self.batch.title, self.title, self.htAmount)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment