Admin
Firebase Auth + Firestore。Googleログイン後にニュースを追加・編集・削除できます。
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /admins/{email} {
allow read: if request.auth != null;
allow write: if request.auth.token.email == email;
}
match /news/{docId} {
allow read: if true;
allow write: if get(/databases/$(database)/documents/admins/$(request.auth.token.email)).data.active == true;
}
}
}
まず admins コレクションに igarin0208@gmail.com のドキュメントを作成し、{ active: true } を入れてください。