Каталог системних ролей¶
Source: backend/core/services/role_catalog.py.
14 ролей, що матеріалізуються в кожному тенанті при apply_system_roles(tenant). Дії з RolePermission:
- view — список + retrieve
- create — POST
- update — PATCH/PUT
- delete — DELETE
- post — провести/скасувати документ (post_document/unpost_document)
- all — wildcard, покриває все вище
Загальні (community-роли)¶
tenant_admin — Tenant Admin (Адміністратор тенанта)¶
Має (*,all) wildcard — повний доступ до всього у тенанті. Прирівняна до is_tenant_admin=True/is_superuser.
- Scope: усе
- Demo-юзери:
eswf(eswf),port(dry_port),admin(agro_holding) — superusers що створюються Phase 0 - Чи редагується через UI: ні — wildcard не виражається в матриці. Лише через "Скинути до каталогу"
accountant — Accountant (Бухгалтер)¶
Повний доступ до Essentials (документи, каса/банк, JournalEntry, FixedAssets), реєстрів, посту PayrollSlip.
- Scope: Essentials master data + transactions + accounting reports + audit + print + reconciliation + bank exchange + exchange rates
- НЕ має: CRM (leads/deals), Shop, mobile-API
- Demo-юзери:
melnyk(eswf),honchar(dry_port),koval/bilous/kravets(agro_holding) — по одному на юрособу
sales_manager — Sales Manager (Менеджер з продажу)¶
CRM (Lead/Deal/Quotation/SalesOrder), Invoice + GoodsShipment з посту, клієнти, контракти, прайс-листи, StoreManager.
- Scope: CRM CRUD+post, Invoice/GoodsShipment CRUD+post, Clients/Contracts CRUD, Items/Warehouse view, pricing, CRM analytics, reports, print
- НЕ має: JournalEntry, FixedAssets, payroll
- Demo-юзери:
melnyk(eswf — поряд з accountant),honchar(dry_port),koval+bulkina(agro_holding)
support_specialist — Support Specialist (Спеціаліст підтримки)¶
Чат, EmailLog, ліцензії клієнтів, перегляд клієнтів/інвойсів.
- Scope: Clients/Contracts/Invoices read-only, Items/PriceTypes view, Print
- Demo-юзери:
tkachenko(eswf),bulkina(agro_holding — поряд із sales)
engineer — Engineer (Інженер)¶
Внутрішній доступ R&D-команди — без фінансів.
- Scope: AttendanceLog, Persons, Employees view
- Demo-юзери:
bondarenko(eswf),sydorenko(agro_holding — агроном як ad-hoc inner role)
hr_specialist — HR Specialist (Спеціаліст HR)¶
HRM (Position/Employee/PayrollPeriod/Slip — compute), Person view, AttendanceLog.
- Scope: HRM CRUD, departments/organizations view, print
- НЕ має: post payroll (це робить accountant)
- Demo-юзери: немає окремого; роль доступна тенант-адмінам для призначення власним HR
auditor — Auditor (Аудитор)¶
Read-only на все Essentials, реєстри, JE, FA, reports + audit log.
- Scope: read-only майже все, плюс reports/print/audit pseudo-entities
- Demo-юзери: немає окремого
Gatehouse plugin (cross-tenant)¶
gate_operator — Gate Operator (Оператор прохідної)¶
Gate events (CRUD+post), checkpoints, vehicles/persons read.
- Scope: GatePoints/Equipment/Roles view, GateCheckpoints CRUD, GateEvents CRUD+post, vehicles/persons/employees view, print
- Demo-юзери:
gate(dry_port),gate_agro(agro_holding) — обидва тенанти мають ворота
weighbridge_operator — Weighbridge Operator (Вагар)¶
WeighingTickets (CRUD+post), створення GoodsReceipt після зважування.
- Scope: WeighingTickets CRUD+post, GateEvents CRUD, vehicles/items view, GoodsReceipt + lines create+view
- Demo-юзери:
weigher(dry_port),weigher_agro(agro_holding — приймання зерна)
ContainerHub roles (dry_port-focused)¶
terminal_dispatcher — Terminal Dispatcher (Диспетчер термінала)¶
Контейнери, бронювання, переміщення, demurrage.
- Scope: Containers/Bookings/Movements CRUD+post, Types/Terminals/YardInventories/ShippingLines/Tariffs CRUD, demurrage view, train arrivals view, gateEvents/weighingTickets view
- Demo-юзери:
dispatcher(dry_port)
yard_manager — Yard Manager (Керівник складської зони)¶
YardInventories CRUD, переміщення в дворі.
- Scope: YardInventories CRUD, ContainerMovements CRUD+post, Containers view+update
- Demo-юзери:
yard(dry_port)
forwarder — Forwarder (Експедитор)¶
Залізнична логістика — train arrivals, manifests, waybills.
- Scope: RailwayRoads/Stations/Wagons CRUD, TrainArrivals CRUD, Containers view, ContainerBookings view+create+update, ShippingLines view, print, reports
- Demo-юзери:
lytvyn(dry_port — митний брокер)
Production / Transport (agro_holding-focused)¶
production_manager — Production Manager (Виробничий менеджер)¶
BOM, WorkOrders, GoodsWriteoffs з посту.
- Scope: BOMs/Lines CRUD, WorkOrders CRUD+post, GoodsWriteoffs CRUD+post, Items/Warehouses view, GoodsReceipts create+view, InventoryJournal view, PayrollSlips view, reports/print
- Demo-юзери:
havryliuk(agro_holding — OliyProm)
transport_dispatcher — Transport Dispatcher (Диспетчер автотранспорту)¶
Vehicles, drivers, waybills, transport invoices, ремонти.
- Scope: Vehicles/Drivers/Routes CRUD, Waybills/Orders/TransportInvoices CRUD+post, Maintenance CRUD, fuel CRUD+post, salary references view, print/reports
- Demo-юзери:
oliynyk(agro_holding — AhroTrans)
Зведена матриця ролей × кількість прав¶
| Code | Permissions | Wildcard | Тенант-приклад |
|---|---|---|---|
| tenant_admin | 1 (*:all) |
so | усі тенанти |
| accountant | 179 | — | melnyk, honchar, koval, bilous, kravets |
| sales_manager | 99 | — | melnyk, honchar, koval, bulkina |
| support_specialist | 10 | — | tkachenko, bulkina |
| engineer | 3 | — | bondarenko, sydorenko |
| hr_specialist | 27 | — | (no demo user yet) |
| gate_operator | 16 | — | gate, gate_agro |
| weighbridge_operator | 20 | — | weigher, weigher_agro |
| terminal_dispatcher | 49 | — | dispatcher |
| yard_manager | 15 | — | yard |
| forwarder | 24 | — | lytvyn |
| production_manager | 36 | — | havryliuk |
| transport_dispatcher | 70 | — | oliynyk |
| auditor | 68 | — | (no demo user yet) |
Точні значення можуть змінюватись по мірі розширення каталогу — актуальні цифри читай з UI (Admin Tools → Roles Matrix) або GET /api/v1/admin/roles/.
Псевдо-entities¶
Окрім реальних entity_code (з EntityRegistry), каталог використовує псевдо-entities для APIView без queryset.model:
| Pseudo-entity | Що покриває | Кому видано (з коробки) |
|---|---|---|
reports |
core.views.reports.* + essentials.views.reports.* + production.reports.api.* |
accountant, sales_manager, auditor, terminal_dispatcher, forwarder, production_manager, transport_dispatcher |
print |
core.views.print.* + print_list.* |
усі робочі ролі (всі окрім engineer) |
audit |
core.views.audit.AuditLogViewSet |
accountant, auditor |
crmAnalytics |
crm.views_analytics.* |
sales_manager, auditor |
pricing |
essentials.views.pricing.* |
sales_manager |
reconciliation |
essentials.views.reconciliation.* |
accountant |
bankExchange |
essentials.views.bank_exchange.* |
accountant |
exchangeRates |
essentials.views.exchange_rates.* |
accountant, auditor |
Settings (BAFSyncSettings, EssentialsModuleSettings) обмежено через IsTenantAdmin, не через каталог — вони містять секрети.