diff --git a/src/server/data.rs b/src/server/data.rs index 63f0552..ba994f8 100644 --- a/src/server/data.rs +++ b/src/server/data.rs @@ -7,6 +7,7 @@ use std::{ use generational_arena::{ Arena, Index, }; +use bitflags::bitflags; use cryptohelpers::{ rsa::{ RsaPublicKey, RsaPrivateKey, @@ -82,6 +83,20 @@ pub enum MaybeEncrypted Unencrypted(Data), } +bitflags! { + /// And additional metadata for values + #[derive(Serialize, Deserialize)] + struct Tags: u16 + { + /// Default + const NONE = 0; + /// This value should be cloned on write unless specified elsewhere. + const COW = 1<<0; + /// This should not show up in searches + const HIDDEN = 1<<1; + } +} + /// Information about a map entry. #[derive(Debug, Serialize, Deserialize)] pub struct Info @@ -92,7 +107,8 @@ pub struct Info modified: u64, enable_versioning: bool, - hidden: bool, + + tags: Tags, owner: Option>, //starts as the user that created (i.e. same as `created_by`), or `None` if ownership is disabled signed: Option>, diff --git a/src/server/user.rs b/src/server/user.rs index 6146be8..f14e84f 100644 --- a/src/server/user.rs +++ b/src/server/user.rs @@ -245,7 +245,7 @@ impl EntityID bitflags! { /// A permission a user or group has for a data item. #[derive(Serialize, Deserialize)] - struct Permission: u32 { + struct Permission: u16 { /// Cannot read or write the item. /// /// However they can see it, unless it is marked "hidden".