-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathfirestore.rules
34 lines (31 loc) · 972 Bytes
/
firestore.rules
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
32
33
34
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /posts/{postId}{
allow read;
allow create,update: if request.auth.uid != null && request.resource.data.title != '';
allow delete: if request.auth.uid == resource.data.user.uid;
match /usersComments/{commentId}{
allow read;
allow create,update: if request.auth.uid != null;
}
}
match /rooms/{roomId}{
allow read;
allow create,update: if request.auth.uid != null && request.resource.data.title != '';
allow delete: if request.auth.uid == resource.data.user.uid;
match /messages/{messageId}{
allow read;
allow create,update: if request.auth.uid != null;
}
}
match /users/{userId}{
allow read;
allow write: if request.auth.uid == userId;
}
match /notifications/{notificationId}{
allow read;
allow write: if request.auth.uid == userId;
}
}
}