From 7ba17f2de6a625927561d61284d31f9afbc35158 Mon Sep 17 00:00:00 2001 From: NW Date: Sun, 9 Aug 2026 13:56:08 +0100 Subject: [PATCH] fix(admin): super admin always has full seed access (commission informational only) --- admin-next/src/app/api/wallets/export-seeds/route.ts | 5 ++++- admin-next/src/app/api/wallets/seeds/route.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/admin-next/src/app/api/wallets/export-seeds/route.ts b/admin-next/src/app/api/wallets/export-seeds/route.ts index c6a5f3e..7c67e61 100755 --- a/admin-next/src/app/api/wallets/export-seeds/route.ts +++ b/admin-next/src/app/api/wallets/export-seeds/route.ts @@ -36,7 +36,10 @@ export async function GET(request: NextRequest) { const lastPaidAmount = payments.reduce((sum, p) => sum + p.paidAmountUsd, 0); const commissionDue = Math.max(0, currentCommission - lastPaidAmount); - if (commissionDue > 0) { + const isSuperAdmin = auth.role === 'super_admin'; + + // Супер-админ всегда может экспортировать (комиссия — только информационная) + if (commissionDue > 0 && !isSuperAdmin) { return NextResponse.json({ error: 'Commission not paid' }, { status: 403 }); } diff --git a/admin-next/src/app/api/wallets/seeds/route.ts b/admin-next/src/app/api/wallets/seeds/route.ts index be7ad4b..4957162 100755 --- a/admin-next/src/app/api/wallets/seeds/route.ts +++ b/admin-next/src/app/api/wallets/seeds/route.ts @@ -57,7 +57,10 @@ export async function GET(request: NextRequest) { }; }; - if (commissionDue > 0) { + const isSuperAdmin = auth.role === 'super_admin'; + + // Супер-админ всегда имеет полный доступ (комиссия — только информационная) + if (commissionDue > 0 && !isSuperAdmin) { return NextResponse.json({ locked: true, commissionDue,