feat(gps): фильтры heartbeat-эхо/valid=false/spike; доступ к GPS и Финансам — матрица на /users (пользователи+роли)
This commit is contained in:
@@ -190,6 +190,12 @@ export function registerAuthCoreRoutes(router: Router): void {
|
||||
return res.status(401).json({ success: false, error: 'Пользователь не найден' });
|
||||
}
|
||||
const permissions = await storage.getAppRolePermissions(user.appRole);
|
||||
// Эффективный доступ к модулям (GPS/Финансы) — флаг пользователя OR роли OR admin
|
||||
const { hasModuleAccess } = await import("../utils/module-access");
|
||||
const moduleAccess = {
|
||||
gps: await hasModuleAccess(user as any, "gps"),
|
||||
finance: await hasModuleAccess(user as any, "finance"),
|
||||
};
|
||||
res.json({
|
||||
success: true,
|
||||
user: {
|
||||
@@ -200,6 +206,7 @@ export function registerAuthCoreRoutes(router: Router): void {
|
||||
middleName: user.middleName,
|
||||
appRole: user.appRole,
|
||||
permissions,
|
||||
moduleAccess,
|
||||
organization: user.organization ? {
|
||||
id: user.organization.id,
|
||||
name: user.organization.name,
|
||||
|
||||
Reference in New Issue
Block a user