Merge pull request #743 from nextcloud/fix_smb_attributes-10

[10] Fix file permissions for SMB (read-only folders will be writeable
This commit is contained in:
Lukas Reschke 2016-08-10 00:23:17 +02:00 committed by GitHub
commit 94d9d52de2
1 changed files with 13 additions and 0 deletions

View File

@ -395,6 +395,19 @@ class SMB extends Common implements INotifyStorage {
}
public function isUpdatable($path) {
try {
$info = $this->getFileInfo($path);
// following windows behaviour for read-only folders: they can be written into
// (https://support.microsoft.com/en-us/kb/326549 - "cause" section)
return !$info->isHidden() && (!$info->isReadOnly() || $this->is_dir($path));
} catch (NotFoundException $e) {
return false;
} catch (ForbiddenException $e) {
return false;
}
}
public function isDeletable($path) {
try {
$info = $this->getFileInfo($path);
return !$info->isHidden() && !$info->isReadOnly();