[#NUMERO_TICKET] TITRE TICKET #2

Merged
malio merged 302 commits from develop into main 2026-03-18 13:16:19 +00:00
2 changed files with 6 additions and 7 deletions
Showing only changes of commit 1f31a3a33f - Show all commits

View File

@@ -68,13 +68,12 @@ async function loadData() {
isLoading.value = true
try {
if (auth.user?.roles?.includes('ROLE_ADMIN')) {
// Admin sees all projects
const allProjects = await projectService.getAll({ archived: false })
projects.value = allProjects
projects.value = await projectService.getAll({ archived: false })
} else {
// Client sees allowed projects
projects.value = auth.user?.allowedProjects ?? []
// allowedProjects are embedded objects from /api/me (with me:read group)
projects.value = (auth.user?.allowedProjects ?? []) as Project[]
}
tickets.value = await clientTicketService.getAll()
} finally {
isLoading.value = false

View File

@@ -41,7 +41,7 @@ class Project
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(['project:read', 'time_entry:read', 'task:read'])]
#[Groups(['project:read', 'time_entry:read', 'task:read', 'me:read'])]
private ?int $id = null;
#[ORM\Column(length: 10, unique: true)]
@@ -51,7 +51,7 @@ class Project
private ?string $code = null;
#[ORM\Column(length: 255)]
#[Groups(['project:read', 'project:write', 'time_entry:read', 'task:read'])]
#[Groups(['project:read', 'project:write', 'time_entry:read', 'task:read', 'me:read'])]
private ?string $name = null;
#[ORM\Column(type: 'text', nullable: true)]