Add sidebar builder

This commit is contained in:
handi
2025-12-04 22:08:15 +01:00
parent e2d96c712e
commit 3c0e58dfc1
6 changed files with 138 additions and 3 deletions

View File

@@ -67,7 +67,7 @@ def verify_user(username: str, password: str):
def get_role_for_user(username: str) -> str:
with closing(get_conn()) as conn:
row = conn.execute(
"SELECT role_id FROM users WHERE username = ?",
"SELECT r.role_text from users u left join roles r on u.role_id = r.role_id WHERE username = ?",
(username,),
).fetchone()
return row[0] if row else "user"