From ecaf3731a67ef3b20cdffd249bd194602c71d809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20de=20Dios=20Fern=C3=A1ndez?= Date: Fri, 12 Oct 2018 13:30:00 +0200 Subject: [PATCH] Only allow GET operations in the API --- src/Entity/Content.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Entity/Content.php b/src/Entity/Content.php index 75964001..c629e89a 100644 --- a/src/Entity/Content.php +++ b/src/Entity/Content.php @@ -16,7 +16,10 @@ use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; /** - * @ApiResource + * @ApiResource( + * collectionOperations={"get"}, + * itemOperations={"get"} + * ) * @ApiFilter(SearchFilter::class) * @ORM\Entity(repositoryClass="Bolt\Repository\ContentRepository") * @ORM\Table(name="bolt_content")