match /users/{userId}/{documents=**} {
allow read: if request.auth.token.email in resource.data.shareWith;
// allow read: if resource.data.test == true;
allow read, write: if request.auth.uid == userId;
}
< /code>
Тем не менее, я все еще получаю ошибку разрешения при попытке получить доступ к документу от другого пользователя, даже если этот документ имеет адрес электронной почты от запрошенного пользователя в ShareWith < /code> поля массива. console.warn({ uid })
const
docRef = doc(db, 'users', uid)
;
return getDoc(docRef).then(d => d.exists() ? d.data() : this.create(docRef));
< /code>
Это вывод консоли:
< /p>
И это db:
Подробнее здесь: [url]https://stackoverflow.com/questions/79703869/getting-read-access-for-subcollections-of-specific-document-in-case-a-field-matc[/url]
У меня есть следующие правила в Cloud Firestore: < /p> [code]match /users/{userId}/{documents=**} { allow read: if request.auth.token.email in resource.data.shareWith; // allow read: if resource.data.test == true; allow read, write: if request.auth.uid == userId; } < /code> Тем не менее, я все еще получаю ошибку разрешения при попытке получить доступ к документу от другого пользователя, даже если этот документ имеет адрес электронной почты от запрошенного пользователя в ShareWith < /code> поля массива. console.warn({ uid }) const docRef = doc(db, 'users', uid) ;
return getDoc(docRef).then(d => d.exists() ? d.data() : this.create(docRef)); < /code> Это вывод консоли: < /p> И это db: