fix: complete acl management

This commit is contained in:
simoleo89
2026-07-12 19:12:24 +02:00
parent 667ec9af4c
commit 4b596226e0
6 changed files with 187 additions and 75 deletions
-11
View File
@@ -20,17 +20,6 @@ export default async function PermissionsPage(_props: { params: Promise<{ locale
countMap[Number(row.rank)] = Number(row.cnt)
}
// Auto-create CMS roles for ranks >= 4
for (const rank of ranks) {
if (rank.id >= 4) {
await prisma.aclRole.upsert({
where: { slug: `rank_${rank.id}` },
create: { slug: `rank_${rank.id}`, title: rank.rank_name || `Rank ${rank.id}` },
update: {},
})
}
}
const ranksWithCounts = ranks.map((rank) => ({
...rank,
userCount: countMap[rank.id] ?? 0,