refactor: Store domains separately from users

This commit is contained in:
selfhoster selfhoster 2026-09-19 09:25:25 +02:00
commit 58a8c375f0
5 changed files with 59 additions and 88 deletions

View file

@ -115,7 +115,11 @@ pub async fn home<D: DatabaseInterface>(
// When the user has no domain (service admin) list all domains
let op = Operation::ListUsers(session.user.domain.clone());
let other_users = if session.user.can_perform(&op) {
match state.db.list_users(session.user.domain.clone()).await {
match state
.db
.list_domain_users(session.user.domain.clone())
.await
{
Ok(other_users) => other_users,
Err(e) => {
return format!("Database error: {e}").into_response();