From d28a3166455b9dd073ac49fbaf759c3760839a66 Mon Sep 17 00:00:00 2001 From: "gorbenko.pavel" Date: Wed, 26 Aug 2026 11:53:49 +0500 Subject: [PATCH] =?UTF-8?q?fix:=20=C2=AB=D0=9B=D0=B8=D1=86=D0=BE,=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B8=D0=BC=D0=B0=D1=8E=D1=89=D0=B5=D0=B5=20?= =?UTF-8?q?=D0=9E=D0=A1/=D0=9D=D0=9C=D0=90=C2=BB=20=D0=BD=D0=B5=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B7=D0=B1=D0=BB=D0=BE=D0=BA=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BB=D0=BE=D1=81=D1=8C=20=D0=BF=D0=BE=D0=B4=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=D0=BC=D0=B5=D0=BD=D0=BE=D0=B9=20=D0=BB=D0=B8=D1=87?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Сравнивал непосредственного руководителя с context.pageContext.user.email — РЕАЛЬНЫМ логином, а не с эффективным. getPendingRowForCurrentUser (через ApprovalListService.getCurrentUserId) отладочную подмену (shared/ impersonation.ts) уже учитывает, поэтому «активный шаг есть» под подменой срабатывал верно, а «это я» — нет: сравнение велось с разными личностями. Теперь оба используют effectiveUserEmail. Co-Authored-By: Claude Opus 5 --- .../requestPortal/forms/Dismissal/DismissalView.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/webparts/requestPortal/forms/Dismissal/DismissalView.tsx b/src/webparts/requestPortal/forms/Dismissal/DismissalView.tsx index 23ebc36..cea2477 100644 --- a/src/webparts/requestPortal/forms/Dismissal/DismissalView.tsx +++ b/src/webparts/requestPortal/forms/Dismissal/DismissalView.tsx @@ -15,6 +15,7 @@ import { } from '../../shared/approval'; import { friendlyErrorMessage } from '../../shared/diagnostics'; import { getManagerEmail } from '../../shared/dictionary'; +import { effectiveUserEmail } from '../../shared/impersonation'; import { approvalListTitle, approvalListTitleForListId, @@ -146,6 +147,14 @@ const DismissalView: React.FC = ({ context, itemId, formKey // сейчас активный шаг: getManagerEmail дублирует тот же запрос // (Employee/Manager, managerType=chief), что approval-route делает для // HeadType.Chief при планировании этого же маршрута (см. README формы). + // + // Сравниваем с effectiveUserEmail, а не с context.pageContext.user.email + // напрямую: getPendingRowForCurrentUser (через ApprovalListService. + // getCurrentUserId) уже учитывает отладочную подмену личности (см. + // shared/impersonation.ts) — без того же самого здесь «активный шаг есть» + // (active=true под подменённым) и «это я» (isManager=false, сравнили с + // РЕАЛЬНЫМ логином) расходились бы, и поле оставалось бы заблокированным + // даже когда подмена указывает именно на этого руководителя. useEffect(() => { if (!data.Employee) return; let alive = true; @@ -153,8 +162,7 @@ const DismissalView: React.FC = ({ context, itemId, formKey .then(([pending, managerEmail]) => { if (!alive) return; const active = !!pending && !pending.isDelegator; - const isManager = - !!managerEmail && managerEmail.toLowerCase() === context.pageContext.user.email.toLowerCase(); + const isManager = !!managerEmail && managerEmail.toLowerCase() === effectiveUserEmail(context).toLowerCase(); setAssetsAcceptorEditable(active && isManager); }) .catch(() => {