Repository navigation
Conversation
The Prisma default everyonePerms = 896 = REPLAY_HOOKS | LIST_ENVIRONMENTS | LIST_REPOSITORIES granted project reprovisioning to every authenticated user by default. Keep only the two list permissions (768) and realign existing rows through a migration mirrored in both prisma trees. Admins who genuinely want everyone-replay can re-grant the permission from the project roles screen. Design: schema default 896 -> 768, UPDATE clearing bit 128 on existing projects, test factories and fixtures aligned on 768. Related: #2878 Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Co-authored-by: Automata <automata@shikanime.studio> Change-Id: I6c0d8f6c87d4a7e236ce27089181dc2c6a6a6964
StephaneTrebel
left a comment
There was a problem hiding this comment.
La migration des valeurs existantes est correcte, mais il manque la migration du défaut SQL vers 768 : l’historique rejoué ne correspond donc plus au schéma Prisma (constat inline). Les 110 tests ciblés et le lint ciblé passent ; la CI est verte, SonarQube annonce 0 nouvelle issue, et aucun fil antérieur n’est ouvert. Ledger #2878 : 3/5 critères démontrés (migration des données, fixtures, lint/tests), défaut partiellement corrigé (création via Prisma régénéré à 768, défaut PostgreSQL encore à 896), et critère de gel de apps/server non satisfait : les modifications de cet arbre restent un blocage de périmètre à arbitrer explicitement, malgré le mirroring annoncé ; #2646 couvre également ce défaut de permissions.
The replay-hooks migration only realigned existing rows; the column DEFAULT 896 installed by 20240723135420_dso survived, so databases built from the migration history kept the permissive default. Add the ALTER TABLE ... SET DEFAULT 768 to the migration, mirrored in both prisma trees, so replayed history matches the declared schema. Design: ALTER TABLE before the row UPDATE; same statement in apps/server (frozen tree mirror). Related: #2878 Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Co-authored-by: Automata <automata@shikanime.studio> Change-Id: I7a41b8c2e9d3f5a6b8c1d2e3f4a5b6c7d8e9f0a1
|
Suivi du round de revue : d3af424 ajoute |
|

0 New Issues
0 Fixed Issues
0 Accepted Issues
No data about coverage (52.90% Estimated after merge)
Pourquoi
À la création d'un projet, le défaut Prisma
everyonePerms = 896accorde la permission « Reprovisionner le projet » (REPLAY_HOOKS, bit 128) au rôle « Tout le monde » : tout utilisateur authentifié peut donc reprovisionner un projet sans y détenir aucun rôle. #2878Quoi
896 → 768(REPLAY_HOOKS | LIST_ENVIRONMENTS | LIST_REPOSITORIES→LIST_ENVIRONMENTS | LIST_REPOSITORIES) dans les deux arbres prisma.20261019120000_drop_replay_hooks_from_everyone_permsretirant le bit 128 d'everyonePermssur les projets existants, mirroirée dans les deux arbres.768.Le bouton de reprovisionnement reste accessible aux propriétaires et administrateurs via
MANAGE; un admin souhaitant rétablir le comportement peut re-cocher la permission dans l'écran des rôles du projet.Références