feat: add user roles and storage quota management

This commit is contained in:
2025-11-02 17:17:13 +01:00
parent 596313b8c5
commit f49d9179f5
10 changed files with 183 additions and 30 deletions

View File

@@ -3,7 +3,7 @@ use std::sync::Arc;
use async_trait::async_trait;
use libertas_core::{
error::{CoreError, CoreResult},
models::User,
models::{Role, User},
repositories::UserRepository,
schema::{CreateUserData, LoginUserData},
services::UserService,
@@ -57,6 +57,9 @@ impl UserService for UserServiceImpl {
hashed_password,
created_at: chrono::Utc::now(),
updated_at: chrono::Utc::now(),
role: Role::User,
storage_quota: 10 * 1024 * 1024 * 1024, // 10 GB
storage_used: 0,
};
self.repo.create(user.clone()).await?;