Google cloud firestore 根集合权限是否扩展到Firebase中的子集合?

Google cloud firestore 根集合权限是否扩展到Firebase中的子集合?,google-cloud-firestore,firebase-security,Google Cloud Firestore,Firebase Security,如果我有以下规则: match /users/{userId} { allow read, write: if request.auth.uid == userId; } 用户也能读/写所有子集合。如果不是,我将如何允许用户从根目录中访问所有子集合。按照您当前编写规则的方式,它仅适用于/users本身中的文档,而不适用于子集合 如果还希望允许访问子集合,可以将匹配更改为: match /users/{userId=**} { 请参阅上的Firebase文档,特别是上的部分

如果我有以下规则:

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

用户也能读/写所有子集合。如果不是,我将如何允许用户从根目录中访问所有子集合。

按照您当前编写规则的方式,它仅适用于
/users
本身中的文档,而不适用于子集合

如果还希望允许访问子集合,可以将匹配更改为:

match /users/{userId=**} {
请参阅上的Firebase文档,特别是上的部分