adding user

master
Avril 4 years ago
parent 45199f35ee
commit 4c3982d816
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -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<Vec<user::EntityID>>, //starts as the user that created (i.e. same as `created_by`), or `None` if ownership is disabled
signed: Option<Vec<Signature>>,

@ -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".

Loading…
Cancel
Save