src/Entity/Cgu.php line 29

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\CguRepository;
  6. /**
  7.  * @ORM\Entity(CguRepository::class)
  8.  * @ApiResource(
  9.  *     denormalizationContext={
  10.  *          "groups"={"cgu:write"}
  11.  *     },
  12.  *     normalizationContext={
  13.  *          "groups"={"cgu:read"}
  14.  *     },
  15.  *     collectionOperations={
  16.  *              "post"={"security"="is_granted('ROLE_ADMIN')"},
  17.  *              "get"={"security"="is_granted('ROLE_ADMIN')"},
  18.  *     },
  19.  *     itemOperations={
  20.  *              "get"={"security"="is_granted('ROLE_USER')"},
  21.  *              "delete"={"security"="is_granted('ROLE_ADMIN')"},
  22.  *              "patch"={"security"="is_granted('ROLE_ADMIN')"},
  23.  *     },
  24.  * )
  25.  */
  26. class Cgu extends TvConfiguration
  27. {
  28. }