mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 02:22:21 +00:00
dav: get_resource replace principal with User
This commit is contained in:
@@ -12,6 +12,7 @@ use async_trait::async_trait;
|
||||
use derive_more::derive::{From, Into};
|
||||
use rustical_dav::resource::{InvalidProperty, Resource, ResourceService};
|
||||
use rustical_dav::xml::HrefElement;
|
||||
use rustical_store::auth::User;
|
||||
use rustical_store::{Addressbook, AddressbookStore};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::str::FromStr;
|
||||
@@ -196,8 +197,8 @@ impl<AS: AddressbookStore + ?Sized> ResourceService for AddressbookResourceServi
|
||||
type Resource = AddressbookResource;
|
||||
type Error = Error;
|
||||
|
||||
async fn get_resource(&self, principal: String) -> Result<Self::Resource, Error> {
|
||||
if self.principal != principal {
|
||||
async fn get_resource(&self, user: User) -> Result<Self::Resource, Error> {
|
||||
if self.principal != user.id {
|
||||
return Err(Error::Unauthorized);
|
||||
}
|
||||
let addressbook = self
|
||||
|
||||
Reference in New Issue
Block a user