fix: complete acl management
This commit is contained in:
1 parent
667ec9af4c
commit
4b596226e0
6 files changed
+187
-75
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user