Fix role detection: compare to Абделазиз not legacy Директор

applySession was still checking the old name, so Абделазиз was
classified as employee and the create-task menu item stayed
hidden.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
sultan 2026-05-25 09:13:22 +05:00
parent f51d1f12c1
commit f32d156e48
2 changed files with 3 additions and 3 deletions

4
app.js
View File

@ -966,11 +966,11 @@ function loginAs(user) {
function applySession(user) {
state.currentUser = user;
localStorage.setItem(USER_KEY, user);
document.body.dataset.role = (user === 'Директор') ? 'director' : 'employee';
document.body.dataset.role = (user === 'Абделазиз') ? 'director' : 'employee';
$('#loginOverlay').hidden = true;
$('#userChip').hidden = false;
$('#userChipName').textContent = user;
$('#userChipRole').textContent = (user === 'Директор') ? 'Директор' : 'Сотрудник';
$('#userChipRole').textContent = (user === 'Абделазиз') ? 'Директор' : 'Сотрудник';
$('#userChipAvatar').textContent = user.slice(0, 1).toUpperCase();
if (!isDirector() && location.hash === '#/create') location.hash = '#/home';
applyRoute();

View File

@ -292,6 +292,6 @@
<script src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/l10n/ru.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
<script src="app.js?v=28"></script>
<script src="app.js?v=29"></script>
</body>
</html>