fireship-io / fkit-course

The Full SvelteKit Course
175 stars 32 forks source link

Add security rules #1

Open camstuart opened 1 year ago

camstuart commented 1 year ago

Hi Jeff, Great course!!

Would it be possible to share the rules you used for firestore and storage please?

lryjnks commented 1 year ago

rules_version = '2';

// Craft rules based on data in your Firestore database // allow write: if firestore.get( // /databases/(default)/documents/users/$(request.auth.uid)).data.isAdmin; service firebase.storage { match /b/{bucket}/o { match /users/{userId}/{allPaths=**} { allow read; allow write: if userId == request.auth.uid; } } }