forked from wangziqi/gongxue-base
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user