diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-19 16:52:03 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-19 16:52:03 +0200 |
commit | 95741f3936501e3ad6aeb26f93eeb28f9decc273 (patch) | |
tree | 36991750b64e6a768c54651ca0c923e4f1e4eb25 /lib/private/files/fileinfo.php | |
parent | 04e6c12fe220171fc2e3c0f634915e7511cafa92 (diff) | |
parent | e5ee84ca9b7c2b95275fa7ea1100fe8c34a4d695 (diff) | |
download | nextcloud-server-95741f3936501e3ad6aeb26f93eeb28f9decc273.tar.gz nextcloud-server-95741f3936501e3ad6aeb26f93eeb28f9decc273.zip |
Merge pull request #8435 from owncloud/fix-8322-master
Expose permission via WebDAV
Diffstat (limited to 'lib/private/files/fileinfo.php')
-rw-r--r-- | lib/private/files/fileinfo.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/private/files/fileinfo.php b/lib/private/files/fileinfo.php index b64c5d4e112..e7afeb4ccce 100644 --- a/lib/private/files/fileinfo.php +++ b/lib/private/files/fileinfo.php @@ -196,4 +196,28 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { public function isShareable() { return $this->checkPermissions(\OCP\PERMISSION_SHARE); } + + /** + * Check if a file or folder is shared + * @return bool + */ + public function isShared() { + $sid = $this->getStorage()->getId(); + if (!is_null($sid)) { + $sid = explode(':', $sid); + return ($sid[0] === 'shared'); + } + + return false; + } + + public function isMounted() { + $sid = $this->getStorage()->getId(); + if (!is_null($sid)) { + $sid = explode(':', $sid); + return ($sid[0] !== 'local' and $sid[0] !== 'home'); + } + + return false; + } } |