mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
dav: Make owner field optional again
This commit is contained in:
@@ -40,7 +40,7 @@ pub enum CommonPropertiesProp {
|
|||||||
|
|
||||||
// WebDAV Access Control Protocol (RFC 3477)
|
// WebDAV Access Control Protocol (RFC 3477)
|
||||||
CurrentUserPrivilegeSet(UserPrivilegeSet),
|
CurrentUserPrivilegeSet(UserPrivilegeSet),
|
||||||
Owner(HrefElement),
|
Owner(Option<HrefElement>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
@@ -93,18 +93,11 @@ pub trait Resource: Clone + 'static {
|
|||||||
CommonPropertiesProp::CurrentUserPrivilegeSet(self.get_user_privileges(user)?)
|
CommonPropertiesProp::CurrentUserPrivilegeSet(self.get_user_privileges(user)?)
|
||||||
}
|
}
|
||||||
CommonPropertiesPropName::Owner => {
|
CommonPropertiesPropName::Owner => {
|
||||||
// TODO: Reintroduce optional owner field
|
CommonPropertiesProp::Owner(self.get_owner().map(|owner| {
|
||||||
let owner = self.get_owner().unwrap_or(&user.id);
|
|
||||||
CommonPropertiesProp::Owner(
|
|
||||||
Self::PrincipalResource::get_url(rmap, [owner])
|
Self::PrincipalResource::get_url(rmap, [owner])
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.into(),
|
.into()
|
||||||
)
|
}))
|
||||||
// CommonPropertiesProp::Owner(self.get_owner().map(|owner| {
|
|
||||||
// Self::PrincipalResource::get_url(rmap, [owner])
|
|
||||||
// .unwrap()
|
|
||||||
// .into()
|
|
||||||
// }))
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user