Skip to content
Snippets Groups Projects
Commit e1807ed0 authored by Morris Jobke's avatar Morris Jobke Committed by GitHub
Browse files

Merge pull request #465 from nextcloud/fix_smb_attributes

Fix file permissions for SMB (read-only folders will be writeable) (#…
parents b5c2b5e8 c376eb9f
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment