I'm working on an app where you can ask your friends to add stuff to your calendar, to plan fun days for and with you. So my main data structure is a Calendar
which contains a list of Events
.
/calendar/{calendarId}/events/{eventId}
And an Event
has the following shape:
type Event {
createdAt: String;
owner: UserReference;
description: String;
title: String;
isLocked: Boolean;
nSlots: SlotNumber;
startSlot: SlotNumber;
startDay: DateString;
location: Location;
isWithOwner: Boolean;
feedback: EventFeedback;
}
Great, users can see someones calendar and add events to it. But my users now gave me the feedback that they would sometimes like to add an event to someone's calendar where the title
is visible, but the description
of the event is hidden to the public.
How would I implement this with the firebase security rules? I understand that access cascades, so if the Event
is visible to someone, all fields are.
A solution I considered: I could keep two lists, of public
and secret
events. The problem is that I still want to show secret
events on the calendar, just their description should be hidden.