Skip to content

Commit

Permalink
Merge branch 'master' into file-structure
Browse files Browse the repository at this point in the history
  • Loading branch information
willwillems committed Oct 3, 2017
1 parent 583bc04 commit f579cd4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
39 changes: 39 additions & 0 deletions database.rules.json
@@ -0,0 +1,39 @@
{
"rules": {
".write": "auth.uid === 'YOURID'",
".read": true,
"posts": {
"$id": {
"author": {
".validate": "newData.isString()"
},
"body": {
".validate": "newData.isString()"
},
"tags": {
".validate": "newData.isString()"
},
"title": {
".validate": "newData.isString()"
},
"created": {
".validate": "newData.val() < now"
},
"$other": {
".validate": false
}
}
},
"settings": {
".validate": true
},
"users": {
"$uid": {
// ".write": "auth != null && auth.uid == $uid && root.child('users').child(auth.uid).child('role').val() === 'admin' "
}
},
"$other": {
".validate": false
}
}
}
3 changes: 3 additions & 0 deletions firebase.json
Expand Up @@ -12,5 +12,8 @@
"destination": "/index.html"
}
]
},
"database": {
"rules": "database.rules.json"
}
}
1 change: 1 addition & 0 deletions src/components/Admin/content/posts.vue
Expand Up @@ -52,6 +52,7 @@
</template>

<script>
import moment from 'moment'
import { postsRef } from '../../../config';
import notifier from '../../../mixins/notifier';
Expand Down

0 comments on commit f579cd4

Please sign in to comment.