1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-06 17:41:01 +00:00

Merge pull request #8092 from wallabag/add-isgranted-to-searchrestcontroller

Add IsGranted to SearchRestController
This commit is contained in:
Yassine Guedidi 2025-03-17 09:22:32 +01:00 committed by GitHub
commit 86e15954c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,7 @@ use Nelmio\ApiDocBundle\Annotation\Operation;
use OpenApi\Annotations as OA;
use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter;
use Pagerfanta\Pagerfanta;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
@ -55,13 +56,12 @@ class SearchRestController extends WallabagRestController
* )
*
* @Route("/api/search.{_format}", name="api_get_search", methods={"GET"}, defaults={"_format": "json"})
* @IsGranted("LIST_ENTRIES")
*
* @return JsonResponse
*/
public function getSearchAction(Request $request, EntryRepository $entryRepository)
{
$this->validateAuthentication();
$term = $request->query->get('term');
$page = (int) $request->query->get('page', 1);
$perPage = (int) $request->query->get('perPage', 30);