diff --git a/spec/controllers/events_spec.cr b/spec/controllers/events_spec.cr index cb71f9a..16c80a4 100644 --- a/spec/controllers/events_spec.cr +++ b/spec/controllers/events_spec.cr @@ -273,7 +273,7 @@ describe Events do WebMock.stub(:get, "https://graph.microsoft.com/v1.0/users/dev%40acaprojects.onmicrosoft.com/calendar/calendarView?startDateTime=2020-08-26T14%3A00%3A00-00%3A00&endDateTime=2020-08-27T13%3A59%3A59-00%3A00&%24filter=iCalUId+eq+%27040000008200E00074C5B7101A82E008000000006DE2E3761F8AD6010000000000000000100000009CCCDBB1F09DE74D8B157797D97F6A10%27&%24top=10000") .to_return(body: File.read("./spec/fixtures/events/o365/events_query.json")) - req_body = EventsHelper.create_event_input + req_body = EventsHelper.create_event_input(permission: PlaceOS::Model::EventMetadata::Permission::PRIVATE) event = JSON.parse(client.post(EVENTS_BASE, headers: headers, body: req_body).body).as_h event_id = event["id"].to_s diff --git a/src/controllers/events.cr b/src/controllers/events.cr index e451514..a1ca354 100644 --- a/src/controllers/events.cr +++ b/src/controllers/events.cr @@ -353,6 +353,9 @@ class Events < Application if breakdown_event_id = input_event.breakdown_event_id meta.breakdown_event_id = breakdown_event_id end + if permission = input_event.permission + meta.permission = permission + end notify_created_or_updated(:create, sys, created_event, meta, can_skip: false, is_host: true) if attending && !attending.empty? @@ -590,6 +593,9 @@ class Events < Application if breakdown_event_id = changes.breakdown_event_id meta.breakdown_event_id = breakdown_event_id end + if permission = changes.permission + meta.permission = permission + end notify_created_or_updated(:update, system, updated_event, meta, can_skip: false, is_host: true) # Grab the list of externals that might be attending