aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller/TagRestController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/TagRestController.php')
-rw-r--r--src/Wallabag/ApiBundle/Controller/TagRestController.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php
index 354187a0..6f460a2d 100644
--- a/src/Wallabag/ApiBundle/Controller/TagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php
@@ -3,6 +3,7 @@
3namespace Wallabag\ApiBundle\Controller; 3namespace Wallabag\ApiBundle\Controller;
4 4
5use Nelmio\ApiDocBundle\Annotation\ApiDoc; 5use Nelmio\ApiDocBundle\Annotation\ApiDoc;
6use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
6use Symfony\Component\HttpFoundation\Request; 7use Symfony\Component\HttpFoundation\Request;
7use Symfony\Component\HttpFoundation\JsonResponse; 8use Symfony\Component\HttpFoundation\JsonResponse;
8use Wallabag\CoreBundle\Entity\Entry; 9use Wallabag\CoreBundle\Entity\Entry;
@@ -14,7 +15,7 @@ class TagRestController extends WallabagRestController
14 * Retrieve all tags. 15 * Retrieve all tags.
15 * 16 *
16 * @ApiDoc() 17 * @ApiDoc()
17 * 18 * @Security("has_role('ROLE_READ')")
18 * @return JsonResponse 19 * @return JsonResponse
19 */ 20 */
20 public function getTagsAction() 21 public function getTagsAction()
@@ -38,7 +39,7 @@ class TagRestController extends WallabagRestController
38 * {"name"="tag", "dataType"="string", "required"=true, "requirement"="\w+", "description"="Tag as a string"} 39 * {"name"="tag", "dataType"="string", "required"=true, "requirement"="\w+", "description"="Tag as a string"}
39 * } 40 * }
40 * ) 41 * )
41 * 42 * @Security("has_role('ROLE_WRITE')")
42 * @return JsonResponse 43 * @return JsonResponse
43 */ 44 */
44 public function deleteTagLabelAction(Request $request) 45 public function deleteTagLabelAction(Request $request)
@@ -71,7 +72,7 @@ class TagRestController extends WallabagRestController
71 * {"name"="tags", "dataType"="string", "required"=true, "format"="tag1,tag2", "description"="Tags as strings (comma splitted)"} 72 * {"name"="tags", "dataType"="string", "required"=true, "format"="tag1,tag2", "description"="Tags as strings (comma splitted)"}
72 * } 73 * }
73 * ) 74 * )
74 * 75 * @Security("has_role('ROLE_WRITE')")
75 * @return JsonResponse 76 * @return JsonResponse
76 */ 77 */
77 public function deleteTagsLabelAction(Request $request) 78 public function deleteTagsLabelAction(Request $request)
@@ -113,7 +114,7 @@ class TagRestController extends WallabagRestController
113 * {"name"="tag", "dataType"="integer", "requirement"="\w+", "description"="The tag"} 114 * {"name"="tag", "dataType"="integer", "requirement"="\w+", "description"="The tag"}
114 * } 115 * }
115 * ) 116 * )
116 * 117 * @Security("has_role('ROLE_WRITE')")
117 * @return JsonResponse 118 * @return JsonResponse
118 */ 119 */
119 public function deleteTagAction(Tag $tag) 120 public function deleteTagAction(Tag $tag)
@@ -133,7 +134,7 @@ class TagRestController extends WallabagRestController
133 134
134 /** 135 /**
135 * Remove orphan tag in case no entries are associated to it. 136 * Remove orphan tag in case no entries are associated to it.
136 * 137 * @Security("has_role('ROLE_WRITE')")
137 * @param Tag|array $tags 138 * @param Tag|array $tags
138 */ 139 */
139 private function cleanOrphanTag($tags) 140 private function cleanOrphanTag($tags)