summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-03-21 14:35:41 +0100
committerRobin Appelman <icewind@owncloud.com>2016-03-21 14:35:41 +0100
commit8ab70b123109a75621b75a3075cc61ea9898df54 (patch)
treee0c363c5324e7c1d73aff74b32cb91e55df3f267 /apps/files_external
parent86581f66265be0dddb97f67ac867a5cb92d335e0 (diff)
downloadnextcloud-server-8ab70b123109a75621b75a3075cc61ea9898df54.tar.gz
nextcloud-server-8ab70b123109a75621b75a3075cc61ea9898df54.zip
properly use smb permissions
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/smb.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index 25acae95fa3..08c4b25a088 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -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
*/