properly use smb permissions

This commit is contained in:
Robin Appelman 2016-03-21 14:35:41 +01:00
parent 86581f6626
commit 8ab70b1231
1 changed files with 22 additions and 0 deletions

View File

@ -349,6 +349,28 @@ class SMB extends Common {
} }
} }
public function isReadable($path) {
try {
$info = $this->getFileInfo($path);
return !$info->isHidden();
} catch (NotFoundException $e) {
return false;
} catch (ForbiddenException $e) {
return false;
}
}
public function isUpdatable($path) {
try {
$info = $this->getFileInfo($path);
return !$info->isHidden() && !$info->isReadOnly();
} catch (NotFoundException $e) {
return false;
} catch (ForbiddenException $e) {
return false;
}
}
/** /**
* check if smbclient is installed * check if smbclient is installed
*/ */