fix: resolve 9 P0+P1 review findings (bills decorators, campus isolation bypass, ding raw crash, batch import counter, SSE multi-tab, interval leak, dept permissions, cycle prevention, tree depth)

This commit is contained in:
2026-07-06 00:38:51 +08:00
parent 90b6ce4aba
commit b3655da012
8 changed files with 75 additions and 6 deletions

View File

@@ -44,7 +44,13 @@ export class CampusScope {
}
const ids = await this.getEffectiveScopeIds();
if (ids.length === 0) return where;
if (ids.length === 0) {
// Non-super-admin with no scoping → match nothing, never leak unfiltered data
if (!this.isSuperAdmin) {
return { ...where, departmentId: In([]) } as unknown as T;
}
return where;
}
return { ...where, departmentId: In(ids) } as unknown as T;
}