Configure the firestore security rules to allow users to only access their own data - efficiently

后端 未结 4 1803
庸人自扰
庸人自扰 2021-02-16 00:01

Using firestore with angularfire2 rc 2.

All is working very nicely in development with no effective security rules.

These are the no security rules - where the cli

4条回答
  •  有刺的猬
    2021-02-16 00:39

    I resolved this issue like this.

    service cloud.firestore {
      match /databases/{database}/documents {
        match /users/{userId} {
           match /{allSubcollections=**} {
            allow read, write: if request.auth.uid == userId;
          }
        }
      }
    }
    

提交回复
热议问题