28 lines
494 B
Rust
28 lines
494 B
Rust
mod database;
|
|
mod error;
|
|
|
|
use chrono::{DateTime, Utc};
|
|
use id::{RoleID, UserID};
|
|
use serde::Serialize;
|
|
|
|
// Exports
|
|
pub use crate::error::Error;
|
|
|
|
#[derive(Serialize, Debug, Clone)]
|
|
pub struct Permission {
|
|
user: UserID,
|
|
role: RoleID,
|
|
created_at: DateTime<Utc>,
|
|
}
|
|
|
|
impl Permission {
|
|
pub fn user(&self) -> &UserID {
|
|
&self.user
|
|
}
|
|
pub fn role(&self) -> &RoleID {
|
|
&self.role
|
|
}
|
|
pub fn created_at(&self) -> DateTime<Utc> {
|
|
self.created_at
|
|
}
|
|
}
|