Initial commit MKD fixes

This commit is contained in:
Arsen
2026-02-04 00:17:04 +05:00
commit de94ad707b
312 changed files with 138754 additions and 0 deletions

54
backend/constants/roleAccess.js Executable file
View File

@@ -0,0 +1,54 @@
/**
* Единый источник прав портала (синхронизирован с constants/roleAccess.ts).
* Роли, разделы по умолчанию, scope по умолчанию.
*/
const ROLE_ACCESS = {
DIRECTOR: ['all'],
ENGINEER: ['dashboard', 'objects', 'requests', 'office', 'development'],
MASTER: ['objects', 'requests'],
LAWYER: ['dashboard', 'legal', 'objects', 'requests'],
FINANCIER: ['dashboard', 'finance', 'office', 'objects'],
HR_MANAGER: ['dashboard', 'hr', 'office'],
PR_MANAGER: ['dashboard', 'pr', 'requests'],
};
const ROLE_NAMES = {
DIRECTOR: 'Директор',
ENGINEER: 'Гл. Инженер',
MASTER: 'Мастер',
LAWYER: 'Юрист',
FINANCIER: 'Финансист',
HR_MANAGER: 'HR-менеджер',
PR_MANAGER: 'PR-менеджер',
};
const ROLE_DEFAULT_SCOPE = {
DIRECTOR: 'all',
ENGINEER: 'all',
MASTER: 'own_district',
LAWYER: 'all',
FINANCIER: 'all',
HR_MANAGER: 'all',
PR_MANAGER: 'all',
};
const SECTION_IDS = [
'dashboard',
'objects',
'requests',
'pr',
'finance',
'legal',
'development',
'hr',
'office',
'admin',
];
module.exports = {
ROLE_ACCESS,
ROLE_NAMES,
ROLE_DEFAULT_SCOPE,
SECTION_IDS,
};