forked from saltycrane/kage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebase-rules.json
More file actions
31 lines (31 loc) · 899 Bytes
/
firebase-rules.json
File metadata and controls
31 lines (31 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// This is copied from the Firebase console so it can be saved to git.
// TODO: write a script to set these rules.
// export default {
// rules: {
// tasks: {
// ".read": true,
// $task: {
// // Allow authenticated users to create new data. Only creator can edit data or delete data.
// ".write": "(!data.exists() && auth != null) || (data.child('createdBy').val() === auth.uid)",
// }
// }
// }
// };
{
"rules": {
"tasks": {
"$userId": {
// Allow access only to the owner of the tasks
".read": "auth.uid === $userId",
".write": "(auth != null && auth.uid === $userId)",
}
},
"users": {
".read": true,
"$userId": {
// Allow creating new users and updating user info only by the owner
".write": "!data.exists() || (auth != null && auth.uid === $userId)",
},
}
}
}