Skip to content

Commit

Permalink
Fix save-as readonly file starts with readonly
Browse files Browse the repository at this point in the history
When read-only shared file can be save-as to
users own storage, then it must be start with
edit permission after save-as. Otherwise,
user must close the doc and reopen again in order
to be able to edit.

Change-Id: I9eacc9373f3333d1ed3fff142d8023667e31342a
Signed-off-by: mert <mert.tumer@collabora.com>
  • Loading branch information
mert authored and timar committed Oct 5, 2020
1 parent f3c028d commit 749ff35
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions loleaflet/src/core/Socket.js
Expand Up @@ -780,9 +780,16 @@ L.Socket = L.Class.extend({
var docUrl = url.split('?')[0];
this._map.options.doc = docUrl;
this._map.options.wopiSrc = encodeURIComponent(docUrl);

// if this is save-as, we need to load the document with edit permission
// otherwise the user has to close the doc then re-open it again
// in order to be able to edit.
if (textMsg.startsWith('saveas:'))
this._map.options.permission = 'edit';
this._map.loadDocument();
this._map.sendInitUNOCommands();


if (textMsg.startsWith('renamefile:')) {
this._map.fire('postMessage', {
msgId: 'File_Rename',
Expand Down

0 comments on commit 749ff35

Please sign in to comment.