From 985ee1e956393a17dfbd0571a062c754d1241f3e Mon Sep 17 00:00:00 2001 From: Yuto Terada Date: Fri, 22 Nov 2024 20:13:55 +0900 Subject: [PATCH] =?UTF-8?q?Firestore=E3=82=BB=E3=82=AD=E3=83=A5=E3=83=AA?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=83=AB=E3=83=BC=E3=83=AB=E3=82=92=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=81=97=E3=80=81=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E3=81=94=E3=81=A8=E3=81=AE=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9?= =?UTF-8?q?=E5=88=B6=E5=BE=A1=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- firebase/firestore.rules | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/firebase/firestore.rules b/firebase/firestore.rules index e726cfe..f97e730 100644 --- a/firebase/firestore.rules +++ b/firebase/firestore.rules @@ -12,8 +12,26 @@ service cloud.firestore { // Make sure to write security rules for your app before that time, or else // all client requests to your Firestore database will be denied until you Update // your rules - match /{document=**} { - allow read, write: if request.time < timestamp.date(2024, 11, 25); + match /users/{userId} { + allow read, write: if request.auth != null + && userId == request.auth.uid; + + match /events/{eventId} { + allow read, write: if request.auth != null + && userId == request.auth.uid; + } + + match /want-todos/{todoId} { + allow read, write: if request.auth != null + && userId == request.auth.uid; + } + } + + match /notifications/{notificationId} { + allow read: if request.auth != null + && resource.data.userId == request.auth.uid; + allow write: if request.auth != null + && request.resource.data.userId == request.auth.uid; } } } \ No newline at end of file