Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -39,6 +39,16 @@ function CalendarPopover({
|
||||
const isOwn = calendar?.id
|
||||
? extractEventBaseUuid(calendar.id) === userData.openpaasId
|
||||
: true;
|
||||
const canManageInvites =
|
||||
isOwn ||
|
||||
!!calendar?.invite?.some((invite) => {
|
||||
const inviteEmail = invite.href
|
||||
.replace(/^mailto:/i, "")
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
const currentEmail = userData.email?.trim().toLowerCase();
|
||||
return inviteEmail === currentEmail && invite.access === 5;
|
||||
});
|
||||
|
||||
// existing calendar params
|
||||
const [name, setName] = useState("");
|
||||
@@ -146,7 +156,7 @@ function CalendarPopover({
|
||||
.filter((u) => !!normaliseEmail(u) && !currentMap.has(normaliseEmail(u)))
|
||||
.map((u) => ({ "dav:href": `mailto:${normaliseEmail(u)}` }));
|
||||
|
||||
if (set.length === 0 && remove.length === 0) return;
|
||||
if ((set.length === 0 && remove.length === 0) || !canManageInvites) return;
|
||||
|
||||
await dispatch(
|
||||
updateDelegationCalendarAsync({
|
||||
|
||||
Reference in New Issue
Block a user