diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-02 17:37:16 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-02 17:37:16 +0200 |
commit | c92c577b5e05ea1d932c6739b87fea8beea21e1b (patch) | |
tree | e194232ae8efd9f97fca8fee61cc9b2df314dac2 /lib/private/files/fileinfo.php | |
parent | 49d9631eee1616b9ae2846886c3d428236c5b81a (diff) | |
download | nextcloud-server-c92c577b5e05ea1d932c6739b87fea8beea21e1b.tar.gz nextcloud-server-c92c577b5e05ea1d932c6739b87fea8beea21e1b.zip |
- Introduce isShared() and isMounted() on FileInfo class
- Reuse these methods on determineIcon()
- Generate permission string for the desktop client
- expose {http://owncloud.org/ns}permissions as additional WebDAV property containing the permission string
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 d6940f50bf1..357364415fb 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; + } } |