Skip to content

Commit

Permalink
Fixed security rules so that they work in the emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasgarnier committed Nov 5, 2018
1 parent 7da4f7c commit f7de991
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions firestore.rules
Expand Up @@ -6,8 +6,8 @@ service cloud.firestore {
// - Validate updates
// - Deletes are not allowed
match /restaurants/{restaurantId} {
allow read, create: if request.auth.uid != null;
allow update: if request.auth.uid != null
allow read, create: if request.auth != null;
allow update: if request.auth != null
&& request.resource.data.name == resource.data.name
allow delete: if false;

Expand All @@ -16,8 +16,8 @@ service cloud.firestore {
// - Authenticated user can create if userId matches
// - Deletes and updates are not allowed
match /ratings/{ratingId} {
allow read: if request.auth.uid != null;
allow create: if request.auth.uid != null
allow read: if request.auth != null;
allow create: if request.auth != null
&& request.resource.data.userId == request.auth.uid;
allow update, delete: if false;

Expand Down

0 comments on commit f7de991

Please sign in to comment.