dav: add default implementation for save_resource

This commit is contained in:
Lennart
2024-11-03 23:17:57 +01:00
parent f2d39e3351
commit e9dc8e01d5
7 changed files with 3 additions and 25 deletions

View File

@@ -185,10 +185,6 @@ impl<C: CalendarStore + ?Sized> ResourceService for CalendarObjectResourceServic
})
}
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
Err(Error::NotImplemented)
}
async fn delete_resource(&self, use_trashbin: bool) -> Result<(), Self::Error> {
self.cal_store
.delete_object(&self.principal, &self.cal_id, &self.object_id, use_trashbin)

View File

@@ -170,8 +170,4 @@ impl<C: CalendarStore + ?Sized> ResourceService for PrincipalResourceService<C>
})
.collect())
}
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
Err(Error::NotImplemented)
}
}

View File

@@ -107,8 +107,4 @@ impl ResourceService for RootResourceService {
async fn get_resource(&self) -> Result<Self::Resource, Self::Error> {
Ok(RootResource)
}
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
Err(Error::NotImplemented)
}
}

View File

@@ -186,10 +186,6 @@ impl<AS: AddressbookStore + ?Sized> ResourceService for AddressObjectResourceSer
})
}
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
Err(Error::NotImplemented)
}
async fn delete_resource(&self, use_trashbin: bool) -> Result<(), Self::Error> {
self.addr_store
.delete_object(&self.principal, &self.cal_id, &self.object_id, use_trashbin)

View File

@@ -171,8 +171,4 @@ impl<A: AddressbookStore + ?Sized> ResourceService for PrincipalResourceService<
})
.collect())
}
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
Err(Error::NotImplemented)
}
}

View File

@@ -100,8 +100,4 @@ impl ResourceService for RootResourceService {
async fn get_resource(&self) -> Result<Self::Resource, Self::Error> {
Ok(RootResource)
}
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
Err(Error::NotImplemented)
}
}

View File

@@ -205,7 +205,9 @@ pub trait ResourceService: Sized + 'static {
}
async fn get_resource(&self) -> Result<Self::Resource, Self::Error>;
async fn save_resource(&self, file: Self::Resource) -> Result<(), Self::Error>;
async fn save_resource(&self, _file: Self::Resource) -> Result<(), Self::Error> {
Err(crate::Error::Unauthorized.into())
}
async fn delete_resource(&self, _use_trashbin: bool) -> Result<(), Self::Error> {
Err(crate::Error::Unauthorized.into())
}