diff options
author | metamuffin <metamuffin@disroot.org> | 2023-10-24 15:08:15 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-10-24 15:08:15 +0200 |
commit | f4f3a16bca576c202887799066bd896863612e2b (patch) | |
tree | 8ddb9cdc47abae7bc615109f241b2cd12e141128 /common/src/user.rs | |
parent | c1afcdc0dc4e59cb2ce1e8c65b69c5647f2132f3 (diff) | |
download | jellything-f4f3a16bca576c202887799066bd896863612e2b.tar jellything-f4f3a16bca576c202887799066bd896863612e2b.tar.bz2 jellything-f4f3a16bca576c202887799066bd896863612e2b.tar.zst |
partial theme implementation
Diffstat (limited to 'common/src/user.rs')
-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>); |