mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-12-17 12:59:01 +08:00
WebDAV: Do not return shared calendars in home-set responses (#1796)
This commit is contained in:
parent
80633c3441
commit
e20bdb71af
2 changed files with 15 additions and 5 deletions
|
|
@ -1745,6 +1745,7 @@ async fn add_base_collection_response(
|
||||||
&access_token.name,
|
&access_token.name,
|
||||||
access_token.primary_id,
|
access_token.primary_id,
|
||||||
true,
|
true,
|
||||||
|
false,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.caused_by(trc::location!())?;
|
.caused_by(trc::location!())?;
|
||||||
|
|
@ -1759,6 +1760,7 @@ async fn add_base_collection_response(
|
||||||
&access_token.name,
|
&access_token.name,
|
||||||
access_token.primary_id,
|
access_token.primary_id,
|
||||||
false,
|
false,
|
||||||
|
false,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.caused_by(trc::location!())?;
|
.caused_by(trc::location!())?;
|
||||||
|
|
|
||||||
|
|
@ -268,8 +268,14 @@ impl PrincipalPropFind for Server {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
PrincipalProperty::CalendarHomeSet => {
|
PrincipalProperty::CalendarHomeSet => {
|
||||||
let hrefs =
|
let hrefs = build_home_set(
|
||||||
build_home_set(self, access_token, name.as_ref(), account_id, true)
|
self,
|
||||||
|
access_token,
|
||||||
|
name.as_ref(),
|
||||||
|
account_id,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
)
|
||||||
.await
|
.await
|
||||||
.caused_by(trc::location!())?;
|
.caused_by(trc::location!())?;
|
||||||
|
|
||||||
|
|
@ -283,6 +289,7 @@ impl PrincipalPropFind for Server {
|
||||||
name.as_ref(),
|
name.as_ref(),
|
||||||
account_id,
|
account_id,
|
||||||
false,
|
false,
|
||||||
|
false,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.caused_by(trc::location!())?;
|
.caused_by(trc::location!())?;
|
||||||
|
|
@ -412,6 +419,7 @@ pub(crate) async fn build_home_set(
|
||||||
name: &str,
|
name: &str,
|
||||||
account_id: u32,
|
account_id: u32,
|
||||||
is_calendar: bool,
|
is_calendar: bool,
|
||||||
|
include_sharings: bool,
|
||||||
) -> trc::Result<Vec<Href>> {
|
) -> trc::Result<Vec<Href>> {
|
||||||
let (collection, resource_name) = if is_calendar {
|
let (collection, resource_name) = if is_calendar {
|
||||||
(Collection::Calendar, DavResourceName::Cal)
|
(Collection::Calendar, DavResourceName::Cal)
|
||||||
|
|
@ -426,7 +434,7 @@ pub(crate) async fn build_home_set(
|
||||||
percent_encoding::utf8_percent_encode(name, RFC_3986),
|
percent_encoding::utf8_percent_encode(name, RFC_3986),
|
||||||
)));
|
)));
|
||||||
|
|
||||||
if account_id == access_token.primary_id() {
|
if include_sharings && account_id == access_token.primary_id() {
|
||||||
for account_id in access_token.all_ids_by_collection(collection) {
|
for account_id in access_token.all_ids_by_collection(collection) {
|
||||||
if account_id != access_token.primary_id() {
|
if account_id != access_token.primary_id() {
|
||||||
let other_name = server
|
let other_name = server
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue