* @param string $path
*/
public function cleanPath($path) {
- if ($path === ""){
+ if ($path === "") {
return $path;
}
$path = \OC\Files\Filesystem::normalizePath($path);
}
}
+ public function isUpdatable($path) {
+ return (bool)($this->getPermissions($path) & \OCP\PERMISSION_UPDATE);
+ }
+
+ public function isCreatable($path) {
+ return (bool)($this->getPermissions($path) & \OCP\PERMISSION_CREATE);
+ }
+
+ public function isSharable($path) {
+ return (bool)($this->getPermissions($path) & \OCP\PERMISSION_SHARE);
+ }
+
+ public function isDeletable($path) {
+ return (bool)($this->getPermissions($path) & \OCP\PERMISSION_DELETE);
+ }
+
public function getPermissions($path) {
$this->init();
$response = $this->client->propfind($this->encodePath($path), array('{http://owncloud.org/ns}permissions'));
$permissions |= \OCP\PERMISSION_CREATE;
}
return $permissions;
+ } else if ($this->is_dir($path)) {
+ return \OCP\PERMISSION_ALL;
+ } else if ($this->file_exists($path)) {
+ return \OCP\PERMISSION_ALL - \OCP\PERMISSION_CREATE;
} else {
- return parent::getPermissions($path);
+ return 0;
}
}
}