feat: add user roles and storage quota management
This commit is contained in:
@@ -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?;
|
||||
|
||||
Reference in New Issue
Block a user