Suite à la revue de conformité du module absences.
Fuite corrigée : GET /api/users et /api/users/{id} n'avaient aucun contrôle
d'accès alors que le groupe user:list exposait les données RH/familiales
(date d'embauche, contrat, soldes de CP, rôles…). Tout utilisateur authentifié
pouvait donc lire ces informations sur tous ses collègues.
- chaque champ RH (isEmployee, hireDate, endDate, contractType, workTimeRatio,
annualLeaveDays, referencePeriodStart, initialLeaveBalance) ainsi que roles
est désormais exposé via #[ApiProperty(security: "is_granted('ROLE_ADMIN') or
object == user")] : visible uniquement par un admin ou par l'utilisateur
lui-même. id et username restent publics (sélecteurs d'assigné, avatars).
Minimisation : suppression de familySituation et nbChildren, collectés et
exposés (form RH, API, outil MCP) mais utilisés par aucun calcul.
- entité User + enum FamilySituation + migration de drop des colonnes
- Serializer MCP, update-user (MCP), EmployeeDrawer, DTO, fixtures, i18n
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35 lines
885 B
TypeScript
35 lines
885 B
TypeScript
export type ContractType = 'CDI' | 'CDD' | 'STAGE' | 'ALTERNANCE' | 'AUTRE'
|
|
|
|
export type UserData = {
|
|
id: number
|
|
'@id'?: string
|
|
username: string
|
|
roles: string[]
|
|
avatarUrl?: string | null
|
|
apiToken?: string | null
|
|
// HR / absence management
|
|
isEmployee?: boolean
|
|
hireDate?: string | null
|
|
endDate?: string | null
|
|
contractType?: ContractType | null
|
|
workTimeRatio?: number
|
|
annualLeaveDays?: number
|
|
referencePeriodStart?: string
|
|
initialLeaveBalance?: number
|
|
}
|
|
|
|
export type UserWrite = {
|
|
username: string
|
|
plainPassword?: string
|
|
roles: string[]
|
|
// HR / absence management
|
|
isEmployee?: boolean
|
|
hireDate?: string | null
|
|
endDate?: string | null
|
|
contractType?: ContractType | null
|
|
workTimeRatio?: number
|
|
annualLeaveDays?: number
|
|
referencePeriodStart?: string
|
|
initialLeaveBalance?: number
|
|
}
|