diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-09-12 23:25:57 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-09-12 23:25:57 +0200 |
commit | c94fe38d3900acff474c909aaa730d7ab51f914d (patch) | |
tree | 3ae99322a136e96ebbb8f6feea2628c66eaf2bfc /lib/files/storage/common.php | |
parent | 68f65b657c398d44508d20b56ccf9ddbee8e3521 (diff) | |
download | nextcloud-server-c94fe38d3900acff474c909aaa730d7ab51f914d.tar.gz nextcloud-server-c94fe38d3900acff474c909aaa730d7ab51f914d.zip |
add getPermissions to storage backends to get all permission flags in one go
Diffstat (limited to 'lib/files/storage/common.php')
-rw-r--r-- | lib/files/storage/common.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php index 1f8b6204802..b2b4ea8eee4 100644 --- a/lib/files/storage/common.php +++ b/lib/files/storage/common.php @@ -54,6 +54,25 @@ abstract class Common extends \OC\Files\Storage\Storage { public function isSharable($path) { return $this->isReadable($path); } + public function getPermissions($path){ + $permissions = 0; + if($this->isCreatable($path)){ + $permissions |= OCP\Share::PERMISSION_CREATE; + } + if($this->isReadable($path)){ + $permissions |= OCP\Share::PERMISSION_READ; + } + if($this->isUpdatable($path)){ + $permissions |= OCP\Share::PERMISSION_UPDATE; + } + if($this->isDeletable($path)){ + $permissions |= OCP\Share::PERMISSION_DELETE; + } + if($this->isSharable($path)){ + $permissions |= OCP\Share::PERMISSION_SHARE; + } + return $permissions; + } // abstract public function file_exists($path); public function filectime($path) { $stat = $this->stat($path); |