remote permissions of a view-only folder: no new file or folder

change the way we evaluate a folder permissions to be read-only when no
new file or new folders can be created

if those permissions are lacking, client will make the local folder
read-only

if those permissions are granted, client will make local folder
read-write

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2024-11-07 16:47:45 +01:00
parent d705cad6b9
commit 2d0529c423
No known key found for this signature in database
GPG key ID: 7D0F74F05C22F553

View file

@ -229,8 +229,6 @@ void PropagateLocalMkdir::startLocalMkdir()
#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15
if (!_item->_remotePerm.isNull() &&
!_item->_remotePerm.hasPermission(RemotePermissions::CanAddFile) &&
!_item->_remotePerm.hasPermission(RemotePermissions::CanRename) &&
!_item->_remotePerm.hasPermission(RemotePermissions::CanMove) &&
!_item->_remotePerm.hasPermission(RemotePermissions::CanAddSubDirectories)) {
try {
FileSystem::setFolderPermissions(newDirStr, FileSystem::FolderPermissions::ReadOnly);