feat: новая функция

This commit is contained in:
2025-10-16 18:44:30 +03:00
parent e0300480e1
commit 927d174f66
33 changed files with 1494 additions and 700 deletions

View File

@@ -30,7 +30,7 @@ function shouldGenerateAiReply(params) {
const { senderType, userId, recipientId } = params;
// Обычные пользователи всегда получают AI ответ
if (senderType !== 'admin') {
if (senderType !== 'editor') {
return true;
}
@@ -103,7 +103,7 @@ function canPerformAdminAction(params) {
}
// editor может все (и свои действия, и readonly действия)
if (role === 'editor') {
if (role === 'editor' || role === 'readonly') {
return editorOnlyActions.includes(action) || readonlyActions.includes(action);
}
@@ -120,7 +120,7 @@ function getAdminSettings(params) {
const { role } = params;
// Editor - полные права
if (role === 'editor') {
if (role === 'editor' || role === 'readonly') {
return {
role: 'editor',
roleDisplay: 'Редактор',