16. // Deny read/write access to all users under any conditions
service cloud.firestore {
match /databases/{database}/documents {
function adminControl() {
return request.auth.token.admin == true;
}
function isLogin() {
return request.auth.uid != null;
}
match /sampleData/{logId} {
allow read: if adminControl();
allow create: if isLogin();
allow update: if adminControl();
allow delete: if adminControl();
}
}
}