From fde9d64dece5fe0c29fe844ae90772a10c86b282 Mon Sep 17 00:00:00 2001 From: Lennart <18233294+lennart-k@users.noreply.github.com> Date: Thu, 7 Sep 2023 21:56:12 +0200 Subject: [PATCH] Add current-user-pivilege-set --- crates/dav/src/routes/calendar.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/crates/dav/src/routes/calendar.rs b/crates/dav/src/routes/calendar.rs index 941e398..0d97c75 100644 --- a/crates/dav/src/routes/calendar.rs +++ b/crates/dav/src/routes/calendar.rs @@ -119,6 +119,7 @@ pub fn generate_propfind_calendar_response( "calendar-description", "owner", "calendar-color", + "current-user-privilege-set", "max-resource-size", ] .iter(), @@ -203,6 +204,31 @@ pub fn generate_propfind_calendar_response( .create_element("max-resource-size") .write_text_content(BytesText::new("10000000"))?; } + "current-user-privilege-set" => { + writer + .create_element("current-user-privilege-set") + // These are just hard-coded for now and will possibly change in the future + .write_inner_content(|writer| { + for privilege in [ + "read", + "read-acl", + "write", + "write-acl", + "write-content", + "read-current-user-privilege-set", + "bind", + "unbind", + ] { + writer.create_element("privilege").write_inner_content( + |writer| { + writer.create_element(privilege).write_empty()?; + Ok(()) + }, + )?; + } + Ok(()) + })?; + } "allprops" => {} _ => invalid_props.push(prop), };