• 1000 собирать данные и другие функции в моем хранилище уже. Если я добавлю строку кода в раздел безопасности, получу ли я эти 30 дней «пробной версии»?
Я пошел, чтобы изменить правила безопасности, чтобы не потерять свою базу данных. Обычные правила:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// This rule allows anyone on the internet to view, edit, and delete
// all data in your Firestore database. It is useful for getting
// started, but it is configured to expire after 30 days because it
// leaves your app open to attackers. At that time, all client
// requests to your Firestore database will be denied.
//
// Make sure to write security rules for your app before that time, or else
// your app will lose access to your Firestore database
match /{document=**} {
allow read, write: if request.time < timestamp.date(2020, 6, 2);
}
}
}
Если я добавлю к нему это правило, не потеряю ли я то, что у меня есть?
match /users/{uid} {
allow read;
allow write: if request.auth.uid == uid;
}
Вот как выглядит окончательный код:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// This rule allows anyone on the internet to view, edit, and delete
// all data in your Firestore database. It is useful for getting
// started, but it is configured to expire after 30 days because it
// leaves your app open to attackers. At that time, all client
// requests to your Firestore database will be denied.
//
// Make sure to write security rules for your app before that time, or else
// your app will lose access to your Firestore database
match /{document=**} {
allow read, write: if request.time < timestamp.date(2020, 6, 2);
}
match /users/{uid} {
allow read;
allow write: if request.auth.uid == uid;
}
}
}