changes to fix the user authentification issues

This commit is contained in:
2026-07-24 18:59:29 +02:00
parent 8dbdcaff56
commit 68596b6939
3 changed files with 185 additions and 74 deletions
+4 -2
View File
@@ -1258,7 +1258,9 @@ def inject_version():
try:
client = MongoClient(MONGODB_HOST, MONGODB_PORT)
db = client[MONGODB_DB]
unread_notification_count = _get_unread_notification_count(db, session['username'], is_admin=is_admin)
# Pass the computed permission instead of the strict is_admin boolean
can_manage = current_permissions.get('actions', {}).get('can_manage_settings', False)
unread_notification_count = _get_unread_notification_count(db, session['username'], is_admin=(is_admin or can_manage))
except Exception:
unread_notification_count = 0
finally:
@@ -7888,7 +7890,7 @@ def register():
page_permissions = {}
for endpoint_name, _ in PERMISSION_PAGE_OPTIONS:
page_permissions[endpoint_name] = request.form.get(f'page_{endpoint_name}') == 'on'
us.add_user(
username,
password,