[DELEGATION] Edit attendance and events, delete event for someone (#553)
* [#523] added way to manage attendance for delegated calendars * [DELEGATION] #523 & #524 changed eventURL calculation for delegated events to have the rigth one * [#524] added drag and drop authorisation to delegated event * [#524] added tests * [#524] support for the permission access * [#524] no edit when delegated event is not public
This commit is contained in:
@@ -7,15 +7,17 @@ export function createEventContext(
|
||||
calendar: Calendar,
|
||||
user: userData
|
||||
): ContextualizedEvent {
|
||||
const isOwn = calendar.ownerEmails?.includes(user.email) ?? false;
|
||||
const isOwn = calendar.owner?.emails?.includes(user.email) ?? false;
|
||||
const isRecurring = event?.uid?.includes("/") ?? false;
|
||||
const isOrganizer = event.organizer
|
||||
? user?.email === event.organizer.cal_address
|
||||
: isOwn;
|
||||
const attendeeEmail = calendar.delegated
|
||||
? calendar.owner?.emails?.[0]
|
||||
: user.email;
|
||||
const currentUserAttendee = event.attendee?.find(
|
||||
(person) => person.cal_address === user.email
|
||||
(person) => person.cal_address === attendeeEmail
|
||||
);
|
||||
|
||||
return {
|
||||
event,
|
||||
calendar,
|
||||
|
||||
Reference in New Issue
Block a user