fix(caldav): Fix permissions to allow for deletion of calendar subscriptions

fixes #84
This commit is contained in:
Lennart
2025-06-23 14:04:09 +02:00
parent e5687c6e43
commit 79c66a0b46
3 changed files with 35 additions and 2 deletions

View File

@@ -292,7 +292,12 @@ impl Resource for CalendarResource {
}
fn get_user_privileges(&self, user: &Principal) -> Result<UserPrivilegeSet, Self::Error> {
if self.cal.subscription_url.is_some() || self.read_only {
if self.cal.subscription_url.is_some() {
return Ok(UserPrivilegeSet::owner_write_properties(
user.is_principal(&self.cal.principal),
));
}
if self.read_only {
return Ok(UserPrivilegeSet::owner_read(
user.is_principal(&self.cal.principal),
));