MediSim / firestore.rules
shadowsilence's picture
Clean re-upload from local project
37d26f1 verified
raw
history blame contribute delete
877 Bytes
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Allow users to read/write their own records in history
match /users/{userId}/history/{document=**} {
allow read, write: if request.auth != null && request.auth.token.email == userId;
}
// User profile and API keys
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.token.email == userId;
// Admin can read all users to approve requests
allow read, update: if request.auth != null && request.auth.token.email == 'htutkoko1994@gmail.com';
}
// Config/App Secrets - Admin only
match /config/app_secrets {
allow read: if false; // Only accessible via Admin SDK on backend
allow write: if request.auth != null && request.auth.token.email == 'htutkoko1994@gmail.com';
}
}
}