diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-11-25 16:28:41 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-11-25 16:30:21 +0100 |
commit | 2c39aec8cb8ce7f74c8edd1111e7f7b6a70cf7c5 (patch) | |
tree | 340a259839e2ce8260115d7aeae3798d91cb7768 /lib/private/files/node | |
parent | 711912a7b3f48065b220a909e8889aba5a93d105 (diff) | |
download | nextcloud-server-2c39aec8cb8ce7f74c8edd1111e7f7b6a70cf7c5.tar.gz nextcloud-server-2c39aec8cb8ce7f74c8edd1111e7f7b6a70cf7c5.zip |
Replace deprecated constant with new class constant
Diffstat (limited to 'lib/private/files/node')
-rw-r--r-- | lib/private/files/node/file.php | 10 | ||||
-rw-r--r-- | lib/private/files/node/folder.php | 8 | ||||
-rw-r--r-- | lib/private/files/node/node.php | 10 | ||||
-rw-r--r-- | lib/private/files/node/root.php | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/lib/private/files/node/file.php b/lib/private/files/node/file.php index 75d5e0166b6..81e251c20b8 100644 --- a/lib/private/files/node/file.php +++ b/lib/private/files/node/file.php @@ -16,7 +16,7 @@ class File extends Node implements \OCP\Files\File { * @throws \OCP\Files\NotPermittedException */ public function getContent() { - if ($this->checkPermissions(\OCP\PERMISSION_READ)) { + if ($this->checkPermissions(\OCP\Constants::PERMISSION_READ)) { /** * @var \OC\Files\Storage\Storage $storage; */ @@ -31,7 +31,7 @@ class File extends Node implements \OCP\Files\File { * @throws \OCP\Files\NotPermittedException */ public function putContent($data) { - if ($this->checkPermissions(\OCP\PERMISSION_UPDATE)) { + if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) { $this->sendHooks(array('preWrite')); $this->view->file_put_contents($this->path, $data); $this->sendHooks(array('postWrite')); @@ -55,7 +55,7 @@ class File extends Node implements \OCP\Files\File { public function fopen($mode) { $preHooks = array(); $postHooks = array(); - $requiredPermissions = \OCP\PERMISSION_READ; + $requiredPermissions = \OCP\Constants::PERMISSION_READ; switch ($mode) { case 'r+': case 'rb+': @@ -73,7 +73,7 @@ class File extends Node implements \OCP\Files\File { case 'ab': $preHooks[] = 'preWrite'; $postHooks[] = 'postWrite'; - $requiredPermissions |= \OCP\PERMISSION_UPDATE; + $requiredPermissions |= \OCP\Constants::PERMISSION_UPDATE; break; } @@ -88,7 +88,7 @@ class File extends Node implements \OCP\Files\File { } public function delete() { - if ($this->checkPermissions(\OCP\PERMISSION_DELETE)) { + if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) { $this->sendHooks(array('preDelete')); $this->view->unlink($this->path); $nonExisting = new NonExistingFile($this->root, $this->view, $this->path); diff --git a/lib/private/files/node/folder.php b/lib/private/files/node/folder.php index 8c7acc339ae..83e20871528 100644 --- a/lib/private/files/node/folder.php +++ b/lib/private/files/node/folder.php @@ -180,7 +180,7 @@ class Folder extends Node implements \OCP\Files\Folder { * @throws \OCP\Files\NotPermittedException */ public function newFolder($path) { - if ($this->checkPermissions(\OCP\PERMISSION_CREATE)) { + if ($this->checkPermissions(\OCP\Constants::PERMISSION_CREATE)) { $fullPath = $this->getFullPath($path); $nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath); $this->root->emit('\OC\Files', 'preWrite', array($nonExisting)); @@ -201,7 +201,7 @@ class Folder extends Node implements \OCP\Files\Folder { * @throws \OCP\Files\NotPermittedException */ public function newFile($path) { - if ($this->checkPermissions(\OCP\PERMISSION_CREATE)) { + if ($this->checkPermissions(\OCP\Constants::PERMISSION_CREATE)) { $fullPath = $this->getFullPath($path); $nonExisting = new NonExistingFile($this->root, $this->view, $fullPath); $this->root->emit('\OC\Files', 'preWrite', array($nonExisting)); @@ -325,11 +325,11 @@ class Folder extends Node implements \OCP\Files\Folder { * @return bool */ public function isCreatable() { - return $this->checkPermissions(\OCP\PERMISSION_CREATE); + return $this->checkPermissions(\OCP\Constants::PERMISSION_CREATE); } public function delete() { - if ($this->checkPermissions(\OCP\PERMISSION_DELETE)) { + if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) { $this->sendHooks(array('preDelete')); $this->view->rmdir($this->path); $nonExisting = new NonExistingFolder($this->root, $this->view, $this->path); diff --git a/lib/private/files/node/node.php b/lib/private/files/node/node.php index bc075911749..c52f5bbd54f 100644 --- a/lib/private/files/node/node.php +++ b/lib/private/files/node/node.php @@ -81,7 +81,7 @@ class Node implements \OCP\Files\Node { * @throws \OCP\Files\NotPermittedException */ public function touch($mtime = null) { - if ($this->checkPermissions(\OCP\PERMISSION_UPDATE)) { + if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) { $this->sendHooks(array('preTouch')); $this->view->touch($this->path, $mtime); $this->sendHooks(array('postTouch')); @@ -163,28 +163,28 @@ class Node implements \OCP\Files\Node { * @return bool */ public function isReadable() { - return $this->checkPermissions(\OCP\PERMISSION_READ); + return $this->checkPermissions(\OCP\Constants::PERMISSION_READ); } /** * @return bool */ public function isUpdateable() { - return $this->checkPermissions(\OCP\PERMISSION_UPDATE); + return $this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE); } /** * @return bool */ public function isDeletable() { - return $this->checkPermissions(\OCP\PERMISSION_DELETE); + return $this->checkPermissions(\OCP\Constants::PERMISSION_DELETE); } /** * @return bool */ public function isShareable() { - return $this->checkPermissions(\OCP\PERMISSION_SHARE); + return $this->checkPermissions(\OCP\Constants::PERMISSION_SHARE); } /** diff --git a/lib/private/files/node/root.php b/lib/private/files/node/root.php index 18e7a6b681a..1e8387dc5cb 100644 --- a/lib/private/files/node/root.php +++ b/lib/private/files/node/root.php @@ -262,7 +262,7 @@ class Root extends Folder implements Emitter { * @return int */ public function getPermissions() { - return \OCP\PERMISSION_CREATE; + return \OCP\Constants::PERMISSION_CREATE; } /** |