feat: add is_admin to User, count_users, ProviderConfigRepository trait, admin migration

This commit is contained in:
2026-03-16 03:22:00 +01:00
parent b35054f23e
commit d80d4e9741
6 changed files with 65 additions and 14 deletions

View File

@@ -22,6 +22,7 @@ pub struct User {
pub subject: String,
pub email: Email,
pub password_hash: Option<String>,
pub is_admin: bool,
pub created_at: DateTime<Utc>,
}
@@ -32,6 +33,7 @@ impl User {
subject: subject.into(),
email,
password_hash: None,
is_admin: false,
created_at: Utc::now(),
}
}
@@ -41,6 +43,7 @@ impl User {
subject: impl Into<String>,
email: Email,
password_hash: Option<String>,
is_admin: bool,
created_at: DateTime<Utc>,
) -> Self {
Self {
@@ -48,6 +51,7 @@ impl User {
subject: subject.into(),
email,
password_hash,
is_admin,
created_at,
}
}
@@ -58,6 +62,7 @@ impl User {
subject: format!("local|{}", Uuid::new_v4()),
email,
password_hash: Some(password_hash.into()),
is_admin: false,
created_at: Utc::now(),
}
}