Bug 103671 - [WOPI] Session is readonly even with UserCanWrite=true
Summary: [WOPI] Session is readonly even with UserCanWrite=true
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-03 08:23 UTC by Aleksander Machniak
Modified: 2016-11-10 17:41 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksander Machniak 2016-11-03 08:23:32 UTC
loolwsd: wsd-21569-21572 0:40:13.180582[ client_ws_000a ] TRC  WOPI::CheckFileInfo header for URI [https://kolab.example.org/wopi/files/o4myN599gzxdMuAKJN6q11?access_token=a5nTINdXDk4EasAFVrgfy35C0Q&permission=edit]:
loolwsd: Date: Thu, 03 Nov 2016 08:10:59 GMT / #011Server: Cowboy / #011content-length: 241 / #011cache-control: max-age=0, private, must-revalidate / #011content-type: application/json; charset=utf-8 / #011Connection: close /
loolwsd: wsd-21569-21572 0:40:13.180688 [ client_ws_000a ] DBG  WOPI::CheckFileInfo returned: {"Version":"1476791439","UserId":"test.test@example.org","UserFriendlyName":"Test,Test","UserCanWrite":true,"Size":18595,"PostMessageOrigin":"https://office.example.org","OwnerId":"test.test@example.org","BaseFileName":"test.odt"}. Call duration: 0.521516s
loolwsd: wsd-21569-21572 0:40:13.180880 [ client_ws_000a ] DBG  Setting the session as readonly

loowsd-1.9.6-1.

p.s. also note "&permission=edit" which is not described in WOPI protocol, though redundant.
Comment 1 Aleksander Machniak 2016-11-03 09:24:18 UTC
I also see "Document saved" notice in the editor bottom toolbar, which does not make sense for readonly session. This might be another issue.
Comment 2 Andras Timar 2016-11-03 09:39:16 UTC
richdocuments passes "UserCanWrite":"true" instead of "UserCanWrite":true and it works. So we receive a string instead of a boolean, maybe it's wrong.

See: https://cgit.freedesktop.org/libreoffice/online/tree/loolwsd/Storage.cpp#n335
Comment 3 Aleksander Machniak 2016-11-03 09:44:16 UTC
I'm not 100% sure but spec says Boolean. http://wopi.readthedocs.io/projects/wopirest/en/latest/files/CheckFileInfo.html?highlight=permission#term-usercanwrite
Comment 4 Michael Meeks 2016-11-03 16:30:02 UTC
Thanks for the report =)
Comment 5 Commit Notification 2016-11-10 17:38:28 UTC
Pranav Kant committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/online/commit/?id=dacf16f2d85d2fb5a4de8da52ce64b6409a7dbcd

tdf#103671: 'true' -> true