diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-21 18:05:45 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-21 18:05:45 +0100 |
commit | 2357bbf80ad030fbcedda4f1895c9de1d053011c (patch) | |
tree | 6e39ecb5ac5052cda87d1c80b93947bfff52a8a3 /apps/files_external | |
parent | 2db67c3308459c4d30935d87970151ea3cca5426 (diff) | |
parent | 8ab70b123109a75621b75a3075cc61ea9898df54 (diff) | |
download | nextcloud-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.php | 22 |
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 */ |