How to temporarely disable edit button?

We’ve integrated OnlyOffice in our own site, and allow collaborative editing. We also allow editing via MS Office (open vor edit via WebDAV) and we allow checking out the document for offline editing.
Now these two methods lock a document for online editing via onlyoffice.
Currently I prevent the user from switching to the edit mode by fiddling with onRequestEditRights. So when the user clicks on the pencil, nothing happens.

What I really wanna do though is to hide the pencil at all. How can I do that?

Setting permissions.edit to false in the config of the client does not work, because an error is displayed when the permissions in the client do not match what the backend says. (Tough that unreasonable for me when I remove permissions in the client.)
If I also disable the permission in the backend to match the client I still have no luck. OnlyOffice caches the document and so it does not know the permissions have changed in the backend.

Then there is a method called denyEditingRights for the editor instance. This does remove the pencil icon but also displays a warning message for the user. Also, this method can not be reversed.

So, how do I disable or hide the pencil (edit button) on the client side?

Document Server version: v6.4.2.6
Type of installation of the Document Server: kubernetes/docker
OS: ubuntu (server), windows 10 (client)
Browser version: Edge v96, Chrome v96

Hello Tobias.

Unfortunately we don’t have ready-to-go solution for your request.

We are working on ‘Hiding interface elements’ feature at the moment. Probably we will release it with Document server v.7.1, but I cannot provide you with exact timeframes of release and whether the item you mentioned (‘pencil’) will be included in it.

Sorry for inconvenience.

Okay, then I’ll wait. Thanks for the reply.