changes to fix the user authentification issues
This commit is contained in:
+4
-2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user