아래의 Firebase 규칙에 해당합니다.Firebase 규칙 결과가 비정상적으로 나타납니다.
"users": {
//".read": "(auth != null) && (auth.uid === newData.child('id').val())",
// A list of users and their associated metadata, which can be updated by the single user or a moderator.
"$userId": {
".write": "(auth != null) && (auth.uid === $userId)",
".read": "(auth != null) && (auth.uid === $userId)",
".validate": "($userId === newData.child('id').val())",
"invites": {
// A list of chat invitations from other users, append-only by anyone.
"$inviteId": {
// Allow the user who created the invitation to read the status of the invitation.
".read": "(auth != null) && (auth.uid === data.child('fromUserId').val())",
".write": "(auth != null) && (!data.exists() || $userId === auth.uid || data.child('fromUserId').val() === auth.uid)",
".validate": "newData.hasChildren(['fromUserId','fromUserName','roomId']) && (newData.child('inviteId').val() === $inviteId)"
}
}
}
}
내가 사용자 2456gd 같은 규칙 시뮬레이터를하려고하면 URL /users/2456gd/
-$userId
에서 검증 단계는 성공합니다. 그러나 /users/2456gd/invites/abcd2
을 시도한 경우 $userId
아래의 확인 단계가 실패합니다.
데이터 나 사용
{
"id":"2456gd",
"fromUserId":"2456gd",
"fromUserName":"abc",
"roomId":"family",
"inviteId":"abcd2"
}
모든 가능한 설명? 그리고 그것에 접근하는 방법.
감사합니다.
'읽기'또는 '쓰기'또는 '둘 다'에 실패했습니다. –
읽기는 첫 번째 URL :/users/2456gd /와 함께 성공하지만 두 번째 URL에서는 실패합니다. – user2536851
정확한 오류를 구문 분석하기가 약간 어렵습니다. 시뮬레이터의 스크린 샷을 JSON, 읽는 경로, 오류 메시지 및 인증 토큰과 공유 할 수 있습니까? –