aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-10-24 15:08:15 +0200
committermetamuffin <metamuffin@disroot.org>2023-10-24 15:08:15 +0200
commitf4f3a16bca576c202887799066bd896863612e2b (patch)
tree8ddb9cdc47abae7bc615109f241b2cd12e141128 /common
parentc1afcdc0dc4e59cb2ce1e8c65b69c5647f2132f3 (diff)
downloadjellything-f4f3a16bca576c202887799066bd896863612e2b.tar
jellything-f4f3a16bca576c202887799066bd896863612e2b.tar.bz2
jellything-f4f3a16bca576c202887799066bd896863612e2b.tar.zst
partial theme implementation
Diffstat (limited to 'common')
-rw-r--r--common/src/user.rs11
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>);