Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/Db
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-01-29 10:29:52 +0300
committerJulius Härtl <jus@bitgrid.net>2020-01-29 10:29:52 +0300
commitc3dc91a7de14669c2e5f41aa85e4b6ebe6726602 (patch)
tree8f7d04ddc715326aed5511767db0644b1c4eedd2 /lib/Db
parent075c01857b83d4823c1d9a621d68a7e823aed92b (diff)
Always use the editor uid if available for writing the file
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/Db')
-rw-r--r--lib/Db/Wopi.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Db/Wopi.php b/lib/Db/Wopi.php
index fab36964..d80c4903 100644
--- a/lib/Db/Wopi.php
+++ b/lib/Db/Wopi.php
@@ -126,4 +126,12 @@ class Wopi extends Entity {
return $this->getTemplateId() !== 0 && $this->getTemplateId() !== null;
}
+ public function isGuest() {
+ return $this->getGuestDisplayname() !== null;
+ }
+
+ public function getUserForFileAccess() {
+ return $this->isGuest() ? $this->getOwnerUid() : $this->getEditorUid();
+ }
+
}