Lock file for collaborative editing


Nextcloud version 12:
Operating system and version Ubuntu 16.04.3:
Nginx version 1.10.3:

Sorry for my english. I have an external storage connected and configured full access for several people. How can I lock a file for editing if this file is already being edited? So if one person edits the file, the other users could not edit it, but only read it.
I tried to use WebDav, but it does not lock the file, but only saves the changes to the last saved user.