diff options
Diffstat (limited to 'common/src')
-rw-r--r-- | common/src/user.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/src/user.rs b/common/src/user.rs index 3c1c5b0..0d4806e 100644 --- a/common/src/user.rs +++ b/common/src/user.rs @@ -1,4 +1,6 @@ use crate::{stream::StreamFormat, user}; +#[cfg(feature = "rocket")] +use rocket::{FromFormField, UriDisplayQuery}; use serde::{Deserialize, Serialize}; use std::{collections::HashMap, fmt::Display}; @@ -8,9 +10,18 @@ pub struct User { pub display_name: String, pub password: Vec<u8>, pub admin: bool, + pub theme: Theme, pub permissions: PermissionSet, } +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)] +#[cfg_attr(feature = "rocket", derive(FromFormField, UriDisplayQuery))] +#[serde(rename_all = "snake_case")] +pub enum Theme { + Dark, + Light, +} + #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct PermissionSet(pub HashMap<UserPermission, bool>); |