Bug 66397

Summary: FILEOPEN: DOCX import not doing anything about 'Restrict Editing'
Product: LibreOffice Reporter: Adam CloudOn <rattles2013>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: aron.budea, cno, ilmari.lauhakangas, jorendc
Priority: medium Keywords: filter:docx
Version: Inherited From OOo   
Hardware: Other   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=65765
https://bugs.documentfoundation.org/show_bug.cgi?id=41190
https://bugs.documentfoundation.org/show_bug.cgi?id=101244
https://bugs.documentfoundation.org/show_bug.cgi?id=120852
Whiteboard: BSA
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 120763, 66398    
Attachments: DOCX containing 2 restricted paragraphs and 1 editable paragraph

Description Adam CloudOn 2013-06-30 13:08:48 UTC
Created attachment 81740 [details]
DOCX containing 2 restricted paragraphs and 1 editable paragraph

Problem description: 
When LO loads a DOCX file that has 'Restrict Editing' protection - it does not do anything about it.
'Restrict Editing' can be used in several ways to protect a document (allow only specific styles to be used, allow only specific sections to be edited by specific people \ users).

Steps to reproduce:
1. Load the attached DOCX 
2. Edit any line of the document

Current behavior:
LO allows you to edit any line of the document.

Expected behavior:
LO should only allow you to edit the 2nd paragraph.
              
Operating System: All
Version: 4.2.0.0.alpha0+ Master
Comment 1 Adam CloudOn 2013-06-30 13:23:35 UTC
Password to disable restrictions is '12345'.
Comment 2 Adam CloudOn 2013-06-30 13:26:34 UTC
The nodes that are not exported back to DOCX are:
 -   <w:permStart> in the 'document.xml' file.
 -   <w:permEnd> in the 'document.xml' file.
 -   <w:documentProtection> in the 'settings.xml' file.
Comment 3 Adam CloudOn 2013-06-30 13:35:18 UTC
> The nodes that are not exported back to DOCX are:
Of course, I meant 'the nodes that are not imported from'.
Comment 4 Cor Nouws 2013-07-01 07:49:03 UTC
Hi Adam,
Thanks for the reports. I can confrim what you notice about the behaviour.
But may I ask: where in Writer can I set restrictions to the editing of a paragraph, different then putting it in a section?
I've not started Word to look at it, but then shouldn't his be an enhancement request for new functionality in the first place?

And a - maybe related - note: there is some protection in Wordt documents for forms (form protection). If anyone works on document protection: pls keep that in mind too, so that there are no accidential changes (not that currently it's perfect or not, but just to take that into account ;) )

Regards,
Cor
Comment 5 Adam CloudOn 2013-07-01 08:06:01 UTC
> I've not started Word to look at it, but then shouldn't his be an
> enhancement request for new functionality in the first place?

You may look at it as an 'Enhancement Request', as this indeed should be an enhancement of LO.
However, in addition to that - this is a serious case of an interoperability bug, that changes a document's core property once it goes through LO.
A user might 'use' LO to get rid of protection of a document (maybe without even knowing).
Comment 6 Jorendc 2013-07-01 09:27:20 UTC
Thanks to Cor who confirmed this 'bug' and asked a good question :-), and the nice reply of Adam, which I agree to -> NEW.

Kind regards,
Joren
Comment 7 QA Administrators 2015-04-01 14:42:47 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2015-04-24 17:41:38 UTC
Confirmed.

Win 7 Pro 64-bit Version: 5.0.0.0.alpha1+ (x64)
Build ID: f3375fa07f27bd2ade519af3c07d69040d10eaa9
TinderBox: Win-x86_64@42, Branch:master, Time: 2015-04-22_23:38:50
Locale: fi_FI
Comment 9 Telesto 2016-11-26 19:03:34 UTC

*** This bug has been marked as a duplicate of bug 101244 ***
Comment 10 Aron Budea 2018-09-19 16:41:32 UTC
I don't think this is a duplicate of bug 101244, rather that it was resolved with bug 66398's fixes by Serge Krot:

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f5c266695a4a88da7db971a21915e2bbf758d48e

tdf#66398 Parse and output permissions for DOCX using bookmarks

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8b7910e0ba63aebb6fd6befa937259420f7266f3

tdf#66398 Enhance unit test: check permissions at content level

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1818bffa3e97a47f5bdde0bca9ea6679b93543d2

tdf#66398 Fix copy-paste: call start() bookmark instead of end()