0

Firebase "Security & Rules"에 일련의 규칙을 추가해야하지만 새 버전에서는 찾을 수 없습니다. 규칙은 다음과 같습니다. firebase의 "Security & Rules"에이 규칙을 추가하는 것에 대해서는 this manual을 언급하고 있습니다. 규칙을 클릭, 왼쪽에 데이터베이스에 가 enter image description hereFirebase 보안 및 규칙

답변

1

클릭하고 거기에 당신이 상단에있는 옵션을 갖게됩니다

{ 
    "rules": { 

    "users": { 
     "$uid": { 
     // grants write access to the owner of this user account whose uid must exactly match the key ($uid) 
     ".write": "auth !== null && auth.uid === $uid", 
     // grants read access to any user who is logged in --&& auth.provider === 'password' 
     ".read": "auth !== null" 
     } 
    }, 

    "usernames": { 
     "$userName": { 
     // grants write access to the owner of this user account whose uid must exactly match the key ($uid) 
     ".write": "root.child('usernames').child($userName).child('uid').val() == auth.uid || root.child('usernames').child($userName).child('uid').val() == null", 
     // grants read access to any user who is logged in --&& auth.provider === 'password' 
     ".read": "auth !== null" 
     } 
    }, 

    "following": { 
     "$uid": { 
     // grants write access to the owner of this user account whose uid must exactly match the key ($uid) 
     ".write": "auth !== null && auth.uid === $uid", 
     // grants read access to any user who is logged in --&& auth.provider === 'password' 
     ".read": "auth !== null" 
     } 
    }, 

    "followedBy": { 
     "$fid": { 
     "$uid": { 
      // grants write access to the owner of this user account whose uid must exactly match the key ($uid) 
      ".write": "auth !== null && auth.uid === $uid", 
      // grants read access to any user who is logged in --&& auth.provider === 'password' 
      ".read": "auth !== null" 
     } 
     } 
    } 

    } 
} 

나는 현재보고 모두가 이러한 규칙을 추가 할 위치로 좀 가이드가 필요 탭을 클릭하면 거기에서 규칙을보고 수정할 수 있습니다.

관련 문제