FireStore Securty kuralları 2

Collection larımın görünümü

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write;
    }
      match /users/{userId}{
    allow create
      allow read : if request.auth.uid != null
      allow write : if request.auth.uid == userId
    }
    match /Comments/{commentsId}{
    allow create: if request.auth.uid !=null
    allow read
    allow write: if request.auth.uid == userId
    }
  }
}

kurallarım şimdilik bunlar.

    match /personelInfo/{personelinfo}
    allow read
    allow write : if request.auth.uid == 'QaNm4J6XFR'
    allow update: if request.auth.uid == 'QaNm4J6XFR'
  }

Mesela personelInfo alanım özel bir alan ve admin haricinde kimsenin değişikli yapamamasını istiyorum

Aynı şekil category oluşturmak içinde kullanıyorum

  match /category/{categoryId}{
  allow read
  allow create : if request.auth.uid == 'QaNm4J6XFR'
  allow write: if request.auth.uid == 'QaNm4J6XFR'}
  }

Yorumlar

Bu blogdaki popüler yayınlar

React JS Yazalım 1

Heroku deploy

Laravel & React 4