Untitled

mail@pastecode.io avatar
unknown
javascript
a year ago
1.1 kB
3
Indexable
Never
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /gallery/{id} {
      allow read, write: if true;
      allow update: if resource.data.large_img == null || request.resource.data.keys().hasOnly(['large_img']);
    }

    match /styles/{id} {
      allow read: if true;
    }

    match /images/{id} {
      allow read, write: if true;
      allow update: if resource.data.large_img == null || request.resource.data.keys().hasOnly(['large_img']);
    }

    match /users/{uid} {
      allow read, write: if request.auth.uid == uid;

      match /checkout_sessions/{id} {
        allow read, write: if request.auth.uid == uid;
      }
      match /subscriptions/{id} {
        allow read: if request.auth.uid == uid;
      }
      match /payments/{id} {
        allow read: if request.auth.uid == uid;
      }
    }

    match /products/{id} {
      allow read: if true;

      match /prices/{id} {
        allow read: if true;
      }

      match /tax_rates/{id} {
        allow read: if true;
      }
    }
  }
}