fabaccess-bffh/bffhd/users/mod.rs

57 lines
1.4 KiB
Rust
Raw Normal View History

2021-12-17 16:43:31 +01:00
/*
2022-03-07 18:27:54 +01:00
* Copyright © 2022 RLKM UG (haftungsbeschränkt).
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2021-12-17 16:43:31 +01:00
*/
2022-03-13 17:29:21 +01:00
use rkyv::{Archive, Deserialize, Infallible, Serialize};
2022-03-10 20:52:34 +01:00
use std::ops::Deref;
use std::sync::Arc;
2021-11-26 22:11:24 +01:00
2022-03-13 17:29:21 +01:00
pub mod db;
2021-12-06 21:53:42 +01:00
2022-03-08 18:56:03 +01:00
pub use crate::authentication::db::PassDB;
2022-03-13 17:29:21 +01:00
use crate::authorization::roles::Role;
2021-11-26 22:11:24 +01:00
2022-03-13 17:29:21 +01:00
#[derive(
Copy,
Clone,
PartialEq,
Eq,
Debug,
Archive,
Serialize,
Deserialize,
serde::Serialize,
serde::Deserialize,
)]
#[archive_attr(derive(Debug, PartialEq, serde::Serialize, serde::Deserialize))]
2021-11-26 22:11:24 +01:00
pub struct User {
2022-03-13 17:29:21 +01:00
id: u64
2021-11-26 22:11:24 +01:00
}
impl User {
2022-03-13 17:29:21 +01:00
pub fn new(id: u64) -> Self {
User { id }
2021-12-17 16:43:31 +01:00
}
2022-03-13 17:29:21 +01:00
pub fn get_username(&self) -> &str {
unimplemented!()
}
pub fn get_roles(&self) -> impl IntoIterator<Item=Role> {
unimplemented!();
[]
}
}