From ccb4475a8d882a28fc84fd2e61c3bfa8ac74e563 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 24 Sep 2014 17:49:52 +0200 Subject: [PATCH] Expose creatable permissions trough fileinfo --- lib/private/files/fileinfo.php | 9 +++++++++ lib/public/files/fileinfo.php | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/lib/private/files/fileinfo.php b/lib/private/files/fileinfo.php index 716b7d3940..8457a2d160 100644 --- a/lib/private/files/fileinfo.php +++ b/lib/private/files/fileinfo.php @@ -183,6 +183,15 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { return $this->checkPermissions(\OCP\PERMISSION_UPDATE); } + /** + * Check whether new files or folders can be created inside this folder + * + * @return bool + */ + public function isCreatable() { + return $this->checkPermissions(\OCP\PERMISSION_CREATE); + } + /** * @return bool */ diff --git a/lib/public/files/fileinfo.php b/lib/public/files/fileinfo.php index 0279050b85..ec81a54156 100644 --- a/lib/public/files/fileinfo.php +++ b/lib/public/files/fileinfo.php @@ -135,6 +135,13 @@ interface FileInfo { */ public function isUpdateable(); + /** + * Check whether new files or folders can be created inside this folder + * + * @return bool + */ + public function isCreatable(); + /** * Check if a file or folder can be deleted *