diff --git a/package.json b/package.json
index ea793af..5109cf2 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ipwhitelist",
- "version": "0.5.105",
+ "version": "0.5.106",
"description": "IP WhiteList microservice for cloud provider",
"main": "server.js",
"scripts": {
diff --git a/v2/src/config/index.js b/v2/src/config/index.js
index 6275900..8d36ca1 100644
--- a/v2/src/config/index.js
+++ b/v2/src/config/index.js
@@ -9,7 +9,7 @@
// ═══════════════════════════════════════════════════════════════════════════════
module.exports = {
- version: '0.5.102',
+ version: '0.5.103',
// ── IAM ──────────────────────────────────────────────────────────────────
iamUrl: process.env.V2_IAM_URL || 'https://auth-api.ngcloud.ru/api/v1/auth/user',
diff --git a/v2/src/router/index.js b/v2/src/router/index.js
index ebef8e6..f278c65 100644
--- a/v2/src/router/index.js
+++ b/v2/src/router/index.js
@@ -40,12 +40,11 @@ function resolveContext(req, res, next) {
req.email = isImpersonated ? u.originalUserEmail : (u.email || '');
req.clientId = isImpersonated ? u.impersonatedCompanyId : (u.activeClientId || u.clientId || '');
req.companyName = u.companyName || req.clientId;
- // Админ: пользователь с WZ01112 + включён toggle «Администратор»
- // По умолчанию adminMode=true для админов (не надо нажимать toggle)
+ // Админ: пользователь с WZ01112 — всегда админ
const allCids = u.allClientIds || [u.clientId || ''];
req.canAdmin = allCids.includes('WZ01112') || u.clientId === 'WZ01112' || !!u.isAdmin;
- req.adminMode = u.adminMode !== undefined ? !!u.adminMode : req.canAdmin;
- req.isAdmin = req.canAdmin && req.adminMode;
+ req.adminMode = req.canAdmin;
+ req.isAdmin = req.canAdmin;
req.isImpersonated = isImpersonated;
req.impersonatedBy = isImpersonated ? u.email : null;
req.allClientIds = allCids;
diff --git a/v2/src/user/index.js b/v2/src/user/index.js
index fe40122..46f3b86 100644
--- a/v2/src/user/index.js
+++ b/v2/src/user/index.js
@@ -25,7 +25,7 @@ function createUserRouter() {
// ── GET / — список записей + форма ──────────────────────────────────
router.get('/', async (req, res) => {
try {
- const isAdmin = req.isAdmin;
+ const isAdmin = req.canAdmin;
const clId = req.clientId;
// ── Переключение компании ──────────────────────────────────────
diff --git a/views/v2/user.ejs b/views/v2/user.ejs
index 895bdd2..014cb97 100644
--- a/views/v2/user.ejs
+++ b/views/v2/user.ejs
@@ -116,7 +116,7 @@
IP WhiteList v<%= version %>
- <%= user.email %><% if (user.isAdmin) { %> (админ)<% } %>
+ <%= user.email %>
Выйти<% if (user.isImpersonated && user.originalUserEmail) { %> (<%= user.originalUserEmail %>)<% } %>