Fix bug where NC Android didn't want to allow file/directory creation

This commit is contained in:
bohwaz 2023-09-11 01:37:05 +02:00
parent cdbcd1b411
commit dc065255e8
2 changed files with 4 additions and 1 deletions

View file

@ -31,6 +31,9 @@ abstract class NextCloud
const PERM_WRITE = 'W'; const PERM_WRITE = 'W';
const PERM_CREATE = 'C'; const PERM_CREATE = 'C';
const PERM_MKDIR = 'K'; const PERM_MKDIR = 'K';
// NextCloud Android is buggy and doesn't differentiate between C and K, you must use CK
// or nothing (eg. C or K alone is not recognized, same with KC)
const PERM_CREATE_FILES_DIRS = 'CK';
const NC_NAMESPACE = 'http://nextcloud.org/ns'; const NC_NAMESPACE = 'http://nextcloud.org/ns';
const OC_NAMESPACE = 'http://owncloud.org/ns'; const OC_NAMESPACE = 'http://owncloud.org/ns';

View file

@ -175,7 +175,7 @@ class Storage extends AbstractStorage
$permissions = []; $permissions = [];
if (is_writeable($target)) { if (is_writeable($target)) {
$permissions = [NextCloud::PERM_WRITE, NextCloud::PERM_CREATE, NextCloud::PERM_DELETE, NextCloud::PERM_RENAME, NextCloud::PERM_MOVE, NextCloud::PERM_MKDIR]; $permissions = [NextCloud::PERM_WRITE, NextCloud::PERM_DELETE, NextCloud::PERM_RENAME, NextCloud::PERM_MOVE, NextCloud::PERM_CREATE_FILES_DIRS];
} }
if (is_readable($target)) { if (is_readable($target)) {