Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -143,16 +143,16 @@ interface AclEntry {
|
|||||||
export function getCalendarVisibility(acl: AclEntry[]): "private" | "public" {
|
export function getCalendarVisibility(acl: AclEntry[]): "private" | "public" {
|
||||||
let hasRead = false;
|
let hasRead = false;
|
||||||
let hasFreeBusy = false;
|
let hasFreeBusy = false;
|
||||||
|
if (acl) {
|
||||||
|
for (const entry of acl) {
|
||||||
|
if (entry.principal !== "{DAV:}authenticated") continue;
|
||||||
|
|
||||||
for (const entry of acl) {
|
if (entry.privilege === "{DAV:}read") {
|
||||||
if (entry.principal !== "{DAV:}authenticated") continue;
|
hasRead = true;
|
||||||
|
break; // highest visibility, can stop
|
||||||
if (entry.privilege === "{DAV:}read") {
|
}
|
||||||
hasRead = true;
|
|
||||||
break; // highest visibility, can stop
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasRead) return "public";
|
if (hasRead) return "public";
|
||||||
return "private";
|
return "private";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user