ACL method and reports
This commit is contained in:
@@ -6,13 +6,20 @@
|
||||
|
||||
use calcard::icalendar::ICalendar;
|
||||
use jmap_proto::types::{acl::Acl, value::AclGrant};
|
||||
use store::{SERIALIZE_OBJ_14_V1, SerializedVersion};
|
||||
use utils::map::vec_map::VecMap;
|
||||
|
||||
#[derive(
|
||||
rkyv::Archive, rkyv::Deserialize, rkyv::Serialize, Debug, Default, Clone, PartialEq, Eq,
|
||||
)]
|
||||
pub struct Calendar {
|
||||
pub preferences: VecMap<u32, CalendarPreferences>,
|
||||
pub acls: Vec<AclGrant>,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
rkyv::Archive, rkyv::Deserialize, rkyv::Serialize, Debug, Default, Clone, PartialEq, Eq,
|
||||
)]
|
||||
pub struct CalendarPreferences {
|
||||
pub name: String,
|
||||
pub description: Option<String>,
|
||||
@@ -21,10 +28,10 @@ pub struct CalendarPreferences {
|
||||
pub is_subscribed: bool,
|
||||
pub is_default: bool,
|
||||
pub is_visible: bool,
|
||||
pub include_in_availability: IncludeInAvailability,
|
||||
/*pub include_in_availability: IncludeInAvailability,
|
||||
pub default_alerts_with_time: VecMap<String, ICalendar>,
|
||||
pub default_alerts_without_time: VecMap<String, ICalendar>,
|
||||
pub time_zone: Timezone,
|
||||
pub time_zone: Timezone,*/
|
||||
}
|
||||
|
||||
pub struct CalendarEvent {
|
||||
@@ -95,3 +102,9 @@ impl From<CalendarRight> for Acl {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SerializedVersion for Calendar {
|
||||
fn serialize_version() -> u8 {
|
||||
SERIALIZE_OBJ_14_V1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,12 @@
|
||||
|
||||
use calcard::vcard::VCard;
|
||||
use jmap_proto::types::{acl::Acl, value::AclGrant};
|
||||
use store::{SERIALIZE_OBJ_15_V1, SerializedVersion};
|
||||
|
||||
#[derive(
|
||||
rkyv::Archive, rkyv::Deserialize, rkyv::Serialize, Debug, Default, Clone, PartialEq, Eq,
|
||||
)]
|
||||
#[rkyv(derive(Debug))]
|
||||
pub struct AddressBook {
|
||||
pub name: String,
|
||||
pub display_name: Option<String>,
|
||||
@@ -57,3 +62,9 @@ impl From<AddressBookRight> for Acl {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SerializedVersion for AddressBook {
|
||||
fn serialize_version() -> u8 {
|
||||
SERIALIZE_OBJ_15_V1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,30 +34,12 @@ impl FileHierarchy for Server {
|
||||
.get(&account_id)
|
||||
.filter(|x| x.modseq == change_id)
|
||||
{
|
||||
let c = println!(
|
||||
"Hierarchy: {:?}",
|
||||
files
|
||||
.files
|
||||
.iter()
|
||||
.map(|f| f.name.clone())
|
||||
.collect::<Vec<_>>()
|
||||
);
|
||||
Ok(files)
|
||||
} else {
|
||||
let mut files = build_file_hierarchy(self, account_id).await?;
|
||||
files.modseq = change_id;
|
||||
let files = Arc::new(files);
|
||||
self.inner.cache.files.insert(account_id, files.clone());
|
||||
|
||||
let c = println!(
|
||||
"Hierarchy: {:?}",
|
||||
files
|
||||
.files
|
||||
.iter()
|
||||
.map(|f| f.name.clone())
|
||||
.collect::<Vec<_>>()
|
||||
);
|
||||
|
||||
Ok(files)
|
||||
}
|
||||
}
|
||||
@@ -68,9 +50,6 @@ async fn build_file_hierarchy(server: &Server, account_id: u32) -> trc::Result<F
|
||||
.fetch_folders::<FileNode>(account_id, Collection::FileNode)
|
||||
.await
|
||||
.caused_by(trc::location!())?;
|
||||
/*.format(|f| {
|
||||
f.name = percent_encoding::utf8_percent_encode(&f.name, NON_ALPHANUMERIC).to_string();
|
||||
});*/
|
||||
let mut files = Files {
|
||||
files: IdBimap::with_capacity(list.len()),
|
||||
size: std::mem::size_of::<Files>() as u64,
|
||||
|
||||
Reference in New Issue
Block a user