feat(survey): show the design survey to every admin

The survey screen, its nav item, route guard and API were gated on the
product.survey rid, which only the super admin held in practice.

Grant 'product' and 'product.survey' to every user type (migration for
existing databases, seed for fresh ones). 'product' only opens the products
menu group — its other children keep their own rids — so nothing else new
becomes visible.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
mahmood
2026-11-26 13:31:00 +03:30
co-authored by Claude Sonnet 5.5
parent 387222851c
commit 5593cef462
2 changed files with 30 additions and 0 deletions
+11
View File
@@ -88,6 +88,17 @@ async function seedAccessControl() {
skipDuplicates: true,
});
}
// The design survey is for every admin, not only the super admin — see the
// 20261126120000_survey_visible_to_all_admins migration. `product` opens the
// «محصولات» menu group; its other children stay gated by their own rids.
const allTypes = await prisma.userType.findMany({ select: { id: true } });
await prisma.permission.createMany({
data: allTypes.flatMap((ut) =>
['product', 'product.survey'].map((rid) => ({ rid, userTypeId: ut.id })),
),
skipDuplicates: true,
});
}
/**