diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..52826782 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: rwieruch +patreon: # rwieruch +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/README.md b/README.md index d65ec92f..179eeae2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [](https://travis-ci.org/the-road-to-react-with-firebase/react-firebase-authentication) [](https://slack-the-road-to-learn-react.wieruch.com/) [](https://greenkeeper.io/) * [Tutorial](https://www.robinwieruch.de/complete-firebase-authentication-react-tutorial/) -* [Live Version of half of the Tutorial](https://react-firebase-authentication.wieruch.com/) ## Variations @@ -107,3 +106,30 @@ REACT_APP_CONFIRMATION_EMAIL_REDIRECT=http://localhost:3000 ``` REACT_APP_CONFIRMATION_EMAIL_REDIRECT=https://mydomain.com ``` + +### Security Rules + +``` +{ + "rules": { + ".read": false, + ".write": false, + "users": { + "$uid": { + ".read": "$uid === auth.uid || root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])", + ".write": "$uid === auth.uid || root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])" + }, + ".read": "root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])", + ".write": "root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])" + }, + "messages": { + ".indexOn": ["createdAt"], + "$uid": { + ".write": "data.exists() ? data.child('userId').val() === auth.uid : newData.child('userId').val() === auth.uid" + }, + ".read": "auth != null", + ".write": "auth != null", + }, + } +} +```