feat: update date_plan_preferences Firestore rules to use auto-IDs
This commit is contained in:
parent
2b1238a64c
commit
b049024ba9
|
|
@ -279,15 +279,16 @@ service cloud.firestore {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Date plan preferences: per-partner preferences for building date plans.
|
// Date plan preferences: per-partner preferences for building date plans.
|
||||||
// Both members can read; each member can write their own preference.
|
// Both members can read; either member can write a preference document.
|
||||||
match /date_plan_preferences/{userId} {
|
// Document IDs are Firestore auto-IDs (not user IDs).
|
||||||
|
match /date_plan_preferences/{prefId} {
|
||||||
allow read: if isCouplesMember(coupleId);
|
allow read: if isCouplesMember(coupleId);
|
||||||
allow create, update: if isCouplesMember(coupleId)
|
allow create, update: if isCouplesMember(coupleId)
|
||||||
&& request.resource.data.keys().hasOnly(['actions'])
|
&& request.resource.data.keys().hasAll(['dateIdeaId', 'createdAt', 'updatedAt'])
|
||||||
&& request.resource.data.actions.keys().hasOnly([request.auth.uid])
|
&& request.resource.data.keys().hasOnly([
|
||||||
&& request.resource.data.actions[request.auth.uid].keys().hasOnly(['action', 'swipedAt'])
|
'dateIdeaId', 'preferredDate', 'preferredTime',
|
||||||
&& request.resource.data.actions[request.auth.uid].action != null
|
'budget', 'duration', 'createdAt', 'updatedAt'
|
||||||
&& request.resource.data.actions[request.auth.uid].swipedAt is timestamp;
|
]);
|
||||||
allow delete: if false;
|
allow delete: if false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue