diff --git a/src/food-market.api/Controllers/Catalog/CountriesController.cs b/src/food-market.api/Controllers/Catalog/CountriesController.cs index 0836f84..1227674 100644 --- a/src/food-market.api/Controllers/Catalog/CountriesController.cs +++ b/src/food-market.api/Controllers/Catalog/CountriesController.cs @@ -57,7 +57,7 @@ public async Task> Get(Guid id, CancellationToken ct) return c is null ? NotFound() : Project(c); } - [HttpPost, Authorize(Roles = "SuperAdmin,Admin")] + [HttpPost, Authorize(Roles = "SuperAdmin")] public async Task> Create([FromBody] CountryInput input, CancellationToken ct) { var e = new Country @@ -73,7 +73,7 @@ public async Task> Create([FromBody] CountryInput input return CreatedAtAction(nameof(Get), new { id = e.Id }, Project(e)); } - [HttpPut("{id:guid}"), Authorize(Roles = "SuperAdmin,Admin")] + [HttpPut("{id:guid}"), Authorize(Roles = "SuperAdmin")] public async Task Update(Guid id, [FromBody] CountryInput input, CancellationToken ct) { var e = await _db.Countries.FirstOrDefaultAsync(x => x.Id == id, ct); diff --git a/src/food-market.web/src/App.tsx b/src/food-market.web/src/App.tsx index a42ed0d..e461cd8 100644 --- a/src/food-market.web/src/App.tsx +++ b/src/food-market.web/src/App.tsx @@ -57,6 +57,7 @@ export default function App() { } /> } /> } /> + } /> {/* Tenant-роуты — обычный AppLayout, но с TenantRouteGuard: @@ -73,7 +74,6 @@ export default function App() { } /> } /> } /> - } /> } /> } /> } /> diff --git a/src/food-market.web/src/components/AppLayout.tsx b/src/food-market.web/src/components/AppLayout.tsx index 376ca30..69f34ed 100644 --- a/src/food-market.web/src/components/AppLayout.tsx +++ b/src/food-market.web/src/components/AppLayout.tsx @@ -6,7 +6,7 @@ import { logout } from '@/lib/auth' import { cn } from '@/lib/utils' import { LayoutDashboard, Package, FolderTree, Ruler, Tag, - Users, Warehouse, Store as StoreIcon, Globe, LogOut, Download, UserCog, Shield, ShieldCheck, + Users, Warehouse, Store as StoreIcon, LogOut, Download, UserCog, Shield, ShieldCheck, Boxes, History, TruckIcon, ShoppingCart, Settings, Menu, X, } from 'lucide-react' import { Logo } from './Logo' @@ -49,9 +49,8 @@ function buildNav(isSuperAdmin: boolean): NavSection[] { { group: 'Продажи', items: [ { to: '/sales/retail', icon: ShoppingCart, label: 'Розничные чеки' }, ]}, - { group: 'Справочники', items: [ - { to: '/catalog/countries', icon: Globe, label: 'Страны' }, - ]}, + // Справочники типа «Страны» — глобальные, управляются SuperAdmin'ом + // в системной консоли. В tenant-меню их больше нет. { group: 'Импорт', items: [ { to: '/admin/import/moysklad', icon: Download, label: 'МойСклад' }, ]}, diff --git a/src/food-market.web/src/components/SuperAdminLayout.tsx b/src/food-market.web/src/components/SuperAdminLayout.tsx index 7e926c7..cadbd5d 100644 --- a/src/food-market.web/src/components/SuperAdminLayout.tsx +++ b/src/food-market.web/src/components/SuperAdminLayout.tsx @@ -3,7 +3,7 @@ import { NavLink, Outlet, useLocation, useNavigate } from 'react-router-dom' import { useQuery } from '@tanstack/react-query' import { ShieldCheck, Building, FileClock, HeartPulse, HardDriveDownload, - Settings, Users, LayoutDashboard, LogOut, Menu, X, ChevronDown, + Settings, Users, LayoutDashboard, LogOut, Menu, X, ChevronDown, Globe, } from 'lucide-react' import { api, getOrgOverride, setOrgOverride } from '@/lib/api' import { logout } from '@/lib/auth' @@ -20,6 +20,9 @@ const NAV: NavSection[] = [ { to: '/super-admin/organizations', icon: Building, label: 'Организации' }, { to: '/super-admin/users', icon: Users, label: 'Пользователи', soon: true }, ]}, + { group: 'Справочники', items: [ + { to: '/super-admin/countries', icon: Globe, label: 'Страны' }, + ]}, { group: 'Аудит', items: [ { to: '/super-admin/audit-log', icon: FileClock, label: 'Журнал действий' }, ]}, diff --git a/src/food-market.web/src/pages/OrganizationSettingsPage.tsx b/src/food-market.web/src/pages/OrganizationSettingsPage.tsx index a0176da..758f3e5 100644 --- a/src/food-market.web/src/pages/OrganizationSettingsPage.tsx +++ b/src/food-market.web/src/pages/OrganizationSettingsPage.tsx @@ -100,7 +100,7 @@ export function OrganizationSettingsPage() {

Валюта и ставка НДС берутся из страны ({form.countryCode}) — - чтобы изменить, откройте справочник Страны. + чтобы изменить — обратитесь к администратору платформы (справочник стран управляется в системной консоли).