docker run --rm -d \
--name owncloud \
-p 18080:8080 \
-e OWNCLOUD_APPS_INSTALL=oauth2 \
-e ADMIN_USERNAME=admin \
-e ADMIN_PASSWORD=admin \
owncloud/server:10.5.0-rc2
nothing related to locking
% curl -u admin:admin 'http://localhost:18080/ocs/v1.php/cloud/capabilities?format=json' | jq | grep lock
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1792 100 1792 0 0 3756 0 --:--:-- --:--:-- --:--:-- 3748
Clients check capabilities endpoint anyway, so they would enable a future manual locking feature based on this data
nothing related to locking found
Please remember to add a test scenario for the new capability to https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiCapabilities/capabilities.feature
I don't think we have a nice solution for this... The main problem is that the LockManager isn't public and it isn't exposed outside of the storage layer. We also need to decide where to place this capability.
Some dirty options, assuming we want this capability be part of the dav app (which is where it will be used):
LockManager, which isn't public, in the dav app.LockManager class to get the timeouts and use them in the dav capabilitiesLockManager, which isn't public, in the dav app.ILockManager in the public namespace to be able to use it in the dav appILockManagerSettings to store the settings of the LockManager.Last option could also be reused to provide an endpoint for the settings page in order to provide server-side validation.
``` /**
namespace OCAFiles;
use OCP\Capabilities\ICapability;
use OCP\IConfig;
/**
/**
* Capabilities constructor.
*
* @param IConfig $config
*/
public function __construct(IConfig $config) {
$this->config = $config;
}
/**
* Return this classes capabilities
*
* @return array
*/
public function getCapabilities() {
return [
'checksums' => [
'supportedTypes' => ['SHA1'],
'preferredUploadType' => 'SHA1'
],
'files' => [
'privateLinks' => true,
'privateLinksDetailsParam' => true,
'bigfilechunking' => true,
'blacklisted_files' => $this->config->getSystemValue('blacklisted_files', ['.htaccess']),
'enable_lock_file_action' => (boolean)($this->config->getAppValue('files', 'enable_lock_file_action', false)),
],
];
}
}
Just a note that in release-10.5.0 the enable_lock_file_action check is changed to:
$enableLockFileAction = (boolean)($config->getAppValue('files', 'enable_lock_file_action', 'no') === 'yes');
This is still to be merged back to core master. That is a bit unfortunate if someone starts working on exposing that capability somewhere.
At the moment, enable_lock_file_action is just a boolean to switch on the file icon icon in the webUI. "enable_lock_file_action_on_webui_client" is its current behavior. PR #37720 is adding a checkbox on the webUI so that this can be switch on/off on the admin webUI, as well as using the occ command.
The description of that checkbox is currently "Enable manual file locking on the web UI".
So it needs to be decided if we want this setting to:
1) control just the webUI locking (and have other settings to control lock behavior on other clients), or;
2) control the UI locking behavior on all clients (if this setting is enabled, then any new enough client - Android, iOS, desktop and webUI... - would display appropriate UI for manual locking.
The answer to this question then determines the description and documentation of the capability.
@pmaier1 @michaelstingl
Assuming that you agree I propose the following
file_locking_support -> general capabilityfile_locking_enable_file_action - > depending on the setting
file_locking_enable_file_action- > depending on the setting
clients would show manual locking feature depending on this capability
There is the existing enable_lock_file_action which is not currently exposed as a capability, and is only used by the webUI browser-based client. Do we leave that the way it is?
(and so it effectively means specifically just enable_lock_file_action_on_web_ui )
Edit: I see that @DeepDiver1975 is exposing the internal setting enable_lock_file_action with the capability name file_locking_enable_file_action - so that deals with my question.