I’ve a Team folder (Group folder) in Nextcloud where a certain group of user has read-rights only. When such a user opens the document with CODE the Secure View opens, so no editing capabilities are available. The file menu has has the Download, Print etc still available. Is there a way to remove those? I know the’re still some ways around downloading the document within Nextcloud anyway which requires some work there, so I would like to see if CODE has the capability to reomve these buttons beside that.
I’ve looked into feature locking, but do no really see a way how to achieve such.
Thanks in advance!
Kind regards, Sebastiaan
Hi @sebastiaanveld, welcome to the Collabora Online forums!
Great to see you here as well—just like on GitHub! 
Unfortunately, feature locking isn’t supported in the CODE version. 
However, you might be able to use the hide button feature: PostMessage API Documentation.
Cheers,
Darshan
Thx Darshan,
I found in Control.StatusBar.js
{type: ‘customtoolitem’, id: ‘save’, command: ‘save’, text: _UNO(‘.uno:Save’), lockUno: ‘.uno:Save’},
{type: ‘customtoolitem’, id: 'print’, command: ‘print’, text: _UNO(‘.uno:Print’, ‘text’), mobile: false, tablet: false, lockUno: ‘.uno:Print’},
Hide_Button
id:
Remove_Button
id:
id is the button ID
So I should use “Remove Button” and “is:save” in PostMessage.
Where do I put this? Do I put this in coolwsd config?
Kind regards, Sebastiaan
Hi Sebastiaan,
No, you don’t need to modify coolwsd.xml
. The Remove_Button
command via postMessage
should be sent from the Nextcloud frontend, where Collabora is embedded inside an <iframe>
.
Take a look at how Nextcloud’s richdocuments app handles this:
richdocuments - document.js (Line 288)
Cheers,
Darshan