refactor: Store domains separately from users
This commit is contained in:
parent
f1a2721cbe
commit
58a8c375f0
5 changed files with 59 additions and 88 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue