feat(core) : expose role and user-rbac api endpoints with processors
This commit is contained in:
@@ -17,7 +17,8 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use InvalidArgumentException;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Serializer\Attribute\Groups;
|
||||
use Symfony\Component\Serializer\Attribute\SerializedName;
|
||||
|
||||
#[ORM\Entity(repositoryClass: DoctrineRoleRepository::class)]
|
||||
#[ORM\Table(name: '`role`')]
|
||||
@@ -54,7 +55,6 @@ class Role
|
||||
private ?string $description;
|
||||
|
||||
#[ORM\Column(name: 'is_system', options: ['comment' => 'True for built-in roles that cannot be deleted'])]
|
||||
#[Groups(['role:read'])]
|
||||
private bool $isSystem;
|
||||
|
||||
/**
|
||||
@@ -111,6 +111,10 @@ class Role
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
// PropertyInfo strips the `is` prefix and would expose this field as `system`.
|
||||
// An explicit SerializedName guarantees the `isSystem` key expected by API clients.
|
||||
#[Groups(['role:read'])]
|
||||
#[SerializedName('isSystem')]
|
||||
public function isSystem(): bool
|
||||
{
|
||||
return $this->isSystem;
|
||||
|
||||
Reference in New Issue
Block a user