summaryrefslogtreecommitdiffstats
path: root/external/folderapi.php
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-06-12 14:50:15 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-06-12 14:50:25 +0200
commit4faa08d70891da48a0f7647f7eb8730f7f9dc82e (patch)
treea7f66c2748e2f731be2f20f2af36181a29bf6ff1 /external/folderapi.php
parenta70a85bc1839fbd2ebb27f051fe7c473107c5204 (diff)
add annotations for api controllers
Diffstat (limited to 'external/folderapi.php')
-rw-r--r--external/folderapi.php37
1 files changed, 31 insertions, 6 deletions
diff --git a/external/folderapi.php b/external/folderapi.php
index bbe32ab24..5b90eff9e 100644
--- a/external/folderapi.php
+++ b/external/folderapi.php
@@ -40,7 +40,7 @@ class FolderAPI extends Controller {
private $folderBusinessLayer;
private $itemBusinessLayer;
- public function __construct(API $api,
+ public function __construct(API $api,
Request $request,
FolderBusinessLayer $folderBusinessLayer,
ItemBusinessLayer $itemBusinessLayer){
@@ -50,6 +50,11 @@ class FolderAPI extends Controller {
}
+ /**
+ * @IsAdminExemption
+ * @IsSubAdminExemption
+ * @Ajax
+ */
public function getAll() {
$userId = $this->api->getUserId();
$result = array(
@@ -64,7 +69,12 @@ class FolderAPI extends Controller {
}
- public function create() {
+ /**
+ * @IsAdminExemption
+ * @IsSubAdminExemption
+ * @Ajax
+ */
+ public function create() {
$userId = $this->api->getUserId();
$folderName = $this->params('name');
$result = array(
@@ -78,12 +88,17 @@ class FolderAPI extends Controller {
return new NewsAPIResult($result);
} catch(BusinessLayerExistsException $ex) {
- return new NewsAPIResult(null, NewsAPIResult::EXISTS_ERROR,
+ return new NewsAPIResult(null, NewsAPIResult::EXISTS_ERROR,
$ex->getMessage());
}
}
+ /**
+ * @IsAdminExemption
+ * @IsSubAdminExemption
+ * @Ajax
+ */
public function delete() {
$userId = $this->api->getUserId();
$folderId = (int) $this->params('folderId');
@@ -92,12 +107,17 @@ class FolderAPI extends Controller {
$this->folderBusinessLayer->delete($folderId, $userId);
return new NewsAPIResult();
} catch(BusinessLayerException $ex) {
- return new NewsAPIResult(null, NewsAPIResult::NOT_FOUND_ERROR,
+ return new NewsAPIResult(null, NewsAPIResult::NOT_FOUND_ERROR,
$ex->getMessage());
}
}
+ /**
+ * @IsAdminExemption
+ * @IsSubAdminExemption
+ * @Ajax
+ */
public function update() {
$userId = $this->api->getUserId();
$folderId = (int) $this->params('folderId');
@@ -108,16 +128,21 @@ class FolderAPI extends Controller {
return new NewsAPIResult();
} catch(BusinessLayerExistsException $ex) {
- return new NewsAPIResult(null, NewsAPIResult::EXISTS_ERROR,
+ return new NewsAPIResult(null, NewsAPIResult::EXISTS_ERROR,
$ex->getMessage());
} catch(BusinessLayerException $ex) {
- return new NewsAPIResult(null, NewsAPIResult::NOT_FOUND_ERROR,
+ return new NewsAPIResult(null, NewsAPIResult::NOT_FOUND_ERROR,
$ex->getMessage());
}
}
+ /**
+ * @IsAdminExemption
+ * @IsSubAdminExemption
+ * @Ajax
+ */
public function read() {
$userId = $this->api->getUserId();
$folderId = (int) $this->params('folderId');