summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-21 18:05:45 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-21 18:05:45 +0100
commit2357bbf80ad030fbcedda4f1895c9de1d053011c (patch)
tree6e39ecb5ac5052cda87d1c80b93947bfff52a8a3 /apps/files_external
parent2db67c3308459c4d30935d87970151ea3cca5426 (diff)
parent8ab70b123109a75621b75a3075cc61ea9898df54 (diff)
downloadnextcloud-server-2357bbf80ad030fbcedda4f1895c9de1d053011c.tar.gz
nextcloud-server-2357bbf80ad030fbcedda4f1895c9de1d053011c.zip
Merge pull request #23439 from owncloud/smb-permissions
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
*/