summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-07-11 21:13:23 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-07-12 19:11:06 +0200
commit08d81615e7aac5107b6dc601bd43a15f92ead17f (patch)
treef0ee55edc71d7c6e6440a2f7b0537f89ccd5fc0a
parentAdd #includes for stuff used in this very file (diff)
downloadonline-08d81615e7aac5107b6dc601bd43a15f92ead17f.tar.gz
online-08d81615e7aac5107b6dc601bd43a15f92ead17f.zip
add .uno:EditAnnotation as exception when in read-only mode
Change-Id: Ic6cd15973a96d20895a1e0dc47fc33692b09ec92 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98589 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--loleaflet/src/control/Toolbar.js9
-rw-r--r--wsd/ClientSession.cpp2
2 files changed, 9 insertions, 2 deletions
diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 640fe00dcc..c2cd5a8371 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -157,7 +157,14 @@ L.Map.include({
},
sendUnoCommand: function (command, json) {
- var isAllowedInReadOnly = command == '.uno:WordCountDialog';
+ var isAllowedInReadOnly = false;
+ var allowedCommands = ['.uno:WordCountDialog', '.uno:EditAnnotation'];
+ for (var i in allowedCommands) {
+ if (allowedCommands[i] === command) {
+ isAllowedInReadOnly = true;
+ break;
+ }
+ }
if (this._permission === 'edit' || isAllowedInReadOnly) {
this._socket.sendMessage('uno ' + command + (json ? ' ' + JSON.stringify(json) : ''));
}
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index abed4c5df3..76e93fa33a 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -992,7 +992,7 @@ bool ClientSession::filterMessage(const std::string& message) const
}
else if (tokens.equals(0, "uno"))
{
- if (tokens.size() > 1 && tokens.equals(1, ".uno:ExecuteSearch"))
+ if (tokens.size() > 1 && (tokens.equals(1, ".uno:ExecuteSearch") || tokens.equals(1, ".uno:EditAnnotation")))
{
allowed = true;
}