|
|
@ -6,10 +6,10 @@ declare(strict_types=1); |
|
|
|
|
|
|
|
|
|
|
|
namespace Chamilo\CoreBundle\Entity; |
|
|
|
namespace Chamilo\CoreBundle\Entity; |
|
|
|
|
|
|
|
|
|
|
|
use ApiPlatform\Core\Annotation\ApiFilter; |
|
|
|
|
|
|
|
use ApiPlatform\Core\Annotation\ApiResource; |
|
|
|
|
|
|
|
use ApiPlatform\Core\Annotation\ApiSubresource; |
|
|
|
use ApiPlatform\Core\Annotation\ApiSubresource; |
|
|
|
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter; |
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; |
|
|
|
|
|
|
|
use ApiPlatform\Metadata\ApiFilter; |
|
|
|
|
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
use Chamilo\CoreBundle\Traits\CourseTrait; |
|
|
|
use Chamilo\CoreBundle\Traits\CourseTrait; |
|
|
|
use Chamilo\CoreBundle\Traits\UserTrait; |
|
|
|
use Chamilo\CoreBundle\Traits\UserTrait; |
|
|
|
use Chamilo\CourseBundle\Entity\CDocument; |
|
|
|
use Chamilo\CourseBundle\Entity\CDocument; |
|
|
@ -22,15 +22,13 @@ use Symfony\Component\Validator\Constraints as Assert; |
|
|
|
#[ORM\Table(name: 'gradebook_category')] |
|
|
|
#[ORM\Table(name: 'gradebook_category')] |
|
|
|
#[ORM\Entity] |
|
|
|
#[ORM\Entity] |
|
|
|
#[ApiResource( |
|
|
|
#[ApiResource( |
|
|
|
attributes: [ |
|
|
|
normalizationContext: [ |
|
|
|
'security' => "is_granted('ROLE_USER')", |
|
|
|
'groups' => ['gradebookCategory:read'], |
|
|
|
], |
|
|
|
], |
|
|
|
denormalizationContext: [ |
|
|
|
denormalizationContext: [ |
|
|
|
'groups' => ['gradebookCategory:write'], |
|
|
|
'groups' => ['gradebookCategory:write'], |
|
|
|
], |
|
|
|
], |
|
|
|
normalizationContext: [ |
|
|
|
security: "is_granted('ROLE_USER')", |
|
|
|
'groups' => ['gradebookCategory:read'], |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
)] |
|
|
|
)] |
|
|
|
#[ApiFilter(SearchFilter::class, properties: [ |
|
|
|
#[ApiFilter(SearchFilter::class, properties: [ |
|
|
|
'course' => 'exact', |
|
|
|
'course' => 'exact', |
|
|
|