forked from wallabag/wallabag
Migrate to Symfony attributes
This commit is contained in:
@ -32,11 +32,10 @@ class AnnotationController extends AbstractFOSRestController
|
||||
*
|
||||
* @see Api\WallabagRestController
|
||||
*
|
||||
* @Route("/annotations/{entry}.{_format}", name="annotations_get_annotations", methods={"GET"}, defaults={"_format": "json"})
|
||||
* @IsGranted("LIST_ANNOTATIONS", subject="entry")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/annotations/{entry}.{_format}', name: 'annotations_get_annotations', methods: ['GET'], defaults: ['_format' => 'json'])]
|
||||
public function getAnnotationsAction(Entry $entry, AnnotationRepository $annotationRepository)
|
||||
{
|
||||
$annotationRows = $annotationRepository->findByEntryIdAndUserId($entry->getId(), $this->getUser()->getId());
|
||||
@ -54,11 +53,10 @@ class AnnotationController extends AbstractFOSRestController
|
||||
*
|
||||
* @see Api\WallabagRestController
|
||||
*
|
||||
* @Route("/annotations/{entry}.{_format}", name="annotations_post_annotation", methods={"POST"}, defaults={"_format": "json"})
|
||||
* @IsGranted("CREATE_ANNOTATIONS", subject="entry")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/annotations/{entry}.{_format}', name: 'annotations_post_annotation', methods: ['POST'], defaults: ['_format' => 'json'])]
|
||||
public function postAnnotationAction(Request $request, Entry $entry)
|
||||
{
|
||||
$data = json_decode($request->getContent(), true);
|
||||
@ -89,11 +87,10 @@ class AnnotationController extends AbstractFOSRestController
|
||||
*
|
||||
* @see Api\WallabagRestController
|
||||
*
|
||||
* @Route("/annotations/{annotation}.{_format}", name="annotations_put_annotation", methods={"PUT"}, defaults={"_format": "json"})
|
||||
* @IsGranted("EDIT", subject="annotation")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/annotations/{annotation}.{_format}', name: 'annotations_put_annotation', methods: ['PUT'], defaults: ['_format' => 'json'])]
|
||||
public function putAnnotationAction(Request $request, Annotation $annotation)
|
||||
{
|
||||
try {
|
||||
@ -125,11 +122,10 @@ class AnnotationController extends AbstractFOSRestController
|
||||
*
|
||||
* @see Api\WallabagRestController
|
||||
*
|
||||
* @Route("/annotations/{annotation}.{_format}", name="annotations_delete_annotation", methods={"DELETE"}, defaults={"_format": "json"})
|
||||
* @IsGranted("DELETE", subject="annotation")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/annotations/{annotation}.{_format}', name: 'annotations_delete_annotation', methods: ['DELETE'], defaults: ['_format' => 'json'])]
|
||||
public function deleteAnnotationAction(Annotation $annotation)
|
||||
{
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user