superuser can edit all docs
authorJan Szejko <janek37@gmail.com>
Fri, 31 Mar 2017 12:00:40 +0000 (14:00 +0200)
committerJan Szejko <janek37@gmail.com>
Fri, 31 Mar 2017 12:00:40 +0000 (14:00 +0200)
apps/catalogue/models/document.py

index 21eb777..ef5a5cc 100755 (executable)
@@ -73,6 +73,8 @@ class Document(Ref):
         return metadata
 
     def can_edit(self, user):
         return metadata
 
     def can_edit(self, user):
+        if user.is_superuser:
+            return True
         if self.owner_user:
             return self.owner_user == user
         else:
         if self.owner_user:
             return self.owner_user == user
         else: