From 8ab70b123109a75621b75a3075cc61ea9898df54 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 21 Mar 2016 14:35:41 +0100 Subject: properly use smb permissions --- apps/files_external/lib/smb.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'apps/files_external') 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 */ -- cgit v1.2.3