summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-29 19:42:02 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-29 19:42:02 +0200
commit88359ac26f56f3c6dae232bb9af529b9a35c758e (patch)
treed509f42b35d7a51c7c01cae9d3d89b425c3e7a26 /archaeological_operations
parent8ff14b5402eb5af8685d2c3783b3bd5bdb2ec9a2 (diff)
downloadIshtar-88359ac26f56f3c6dae232bb9af529b9a35c758e.tar.bz2
Ishtar-88359ac26f56f3c6dae232bb9af529b9a35c758e.zip
Access control: collaborators are included in get_own_query for operations, context records and finds (refs #3196)
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/models.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 782f9cf35..13997a632 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -572,8 +572,10 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,
@classmethod
def get_query_owns(cls, user):
- return (Q(in_charge=user.ishtaruser.person) |\
- Q(scientist=user.ishtaruser.person) |\
+ return (
+ Q(in_charge=user.ishtaruser.person) |
+ Q(scientist=user.ishtaruser.person) |
+ Q(collaborators__pk=user.ishtaruser.person.pk) |
Q(history_creator=user)) & Q(end_date__isnull=True)
def is_active(self):