[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - wsd/DocumentBroker.cpp

Jan Holesovsky kendy at collabora.com
Mon Jun 26 03:20:51 UTC 2017


 wsd/DocumentBroker.cpp |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 71de2838753b3b721dcb008841dc56f75973ca7f
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Jun 14 13:51:53 2017 +0200

    wsd: Honor the hosting/discovery read-only setting in LocalStorage too.
    
    To make the debugging easier...
    
    Change-Id: I7c6e748e72a595a6c3a5942a20874339b8456f19
    Reviewed-on: https://gerrit.libreoffice.org/38779
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index cd7c3438..9bf15305 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -460,6 +460,12 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
             std::unique_ptr<LocalStorage::LocalFileInfo> localfileinfo = localStorage->getLocalFileInfo();
             userid = localfileinfo->_userid;
             username = localfileinfo->_username;
+
+            if (LOOLWSD::IsViewFileExtension(localStorage->getFileExtension()))
+            {
+                LOG_DBG("Setting the session as readonly");
+                session->setReadOnly();
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list