1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use bson::oid::ObjectId;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Name {
pub complete: String,
pub title: String,
pub prefix: String,
pub first: String,
pub middle: String,
pub last: String,
pub suffix: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct User {
pub id: ObjectId,
pub key: String,
}
pub trait UserSpecification {
type Identity;
type Condition;
type Context;
fn authorize(&self) -> Self::Condition;
}