registry: карта GROUP (Вопросы / Класс и ученики / Библиотека / Курсы и шаблоны /
Геймификация / Контент / Тесты и активность / Профиль), проброшена в byRole.group.
permissions.js: вкладка «Доступ · роли» рендерит права секциями по группам, у
каждой — «включить все / выключить все» (с подтверждением, если в группе есть
requireConfirmOff). Карточка вынесена в permCard(). Тест: definitions содержат group.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Тест permissions-registry: каждый ключ из requirePermission/perm('…') в backend
есть в registry (ловит опечатки/дрейф; perm() падал на старте, сырой
requirePermission — нет). Заодно логирует ключи реестра, не используемые в
requirePermission (информативно — часть гейтится на клиенте через /me).
Метки theory.access/simulations.access переформулированы: «… доступен роли»
(видимость конкретного контента — по классам в «Доступ · контент»).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
registry: поле requires (questions.delete→manage, templates.public→manage,
courses.interactive→manage, simulations.quiz→access), проброшено в byRole.
auth.requirePermission: вынесен isEnabled(); право = own AND все requires
(дочернее не работает без родителя). /me и /users/🆔 effective с учётом
requires + requires в ответе. UI permissions.js: каскад — дочернее с
невыполненной зависимостью неактивно (тумблер заблокирован + «Требует: …»).
Тест зависимости. План: plans/permissions-rework/PLAN.md. Backend 216 pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- registry.js: добавлен флаг requireConfirmOff для 7 критичных прав (questions.manage, classes.manage, library.upload, courses.manage, sessions.reset, theory.access, simulations.access); byRole() теперь возвращает это поле
- admin.html: subtitle в модале прав — «учителя» → «пользователя»; tooltip на кнопке «Сбросить всё по умолчанию»; поле поиска над сеткой прав; CSS .perm-modified-dot (amber, 8px)
- admin.js: badge «Инд.» → «Индивидуально» (font-size 11px); renderPermissions() рисует .perm-modified-dot когда значение отличается от registry default; togglePermission() показывает LS.confirm перед выключением критичных прав; window.filterPermissions() скрывает карточки и role-блоки по поисковому запросу
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- backend/src/permissions/registry.js: single source of truth (PERMISSIONS map)
with all 24 keys (16 teacher + 8 student, student keys also cover free_student).
Exports isKnown(), listKeys(), byRole(), buildDefaultsMap().
- auth.js: PERM_DEFAULTS now sourced from registry.buildDefaultsMap();
new perm() helper validates key at registration time (crashes early on typos).
requirePermission() unchanged — backward compat preserved.
- permissionsController.js: ALL_PERMISSIONS now built from registry.byRole();
inline 24-entry array removed. API response shape unchanged.
- check-route-auth.js: validates every requirePermission/perm call key against
registry; lists unknown keys as errors before exit.
perm() added to GUARDS list so it counts as route protection.
Discrepancy noted: auth.js had free_student with same 8 keys as student;
permissionsController never seeded free_student rows. Registry documents
this via roles:[] array; buildDefaultsMap() correctly covers free_student.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>