-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfirestore.rules
More file actions
34 lines (30 loc) · 1.2 KB
/
firestore.rules
File metadata and controls
34 lines (30 loc) · 1.2 KB
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 {
// Allow read access to admins collection for authenticated users
match /admins/{document} {
allow read: if request.auth != null;
allow write: if request.auth != null && request.auth.token.email in ['prathmeshojha2307@gmail.com'];
}
// Allow read/write access to users collection for authenticated users
match /users/{userId} {
allow read, write: if request.auth != null &&
(request.auth.uid == resource.data.authUid ||
request.auth.token.email in ['prathmeshojha2307@gmail.com']);
}
// Allow read access to songs collection for all users
match /songs/{songId} {
allow read: if true;
allow write: if request.auth != null &&
request.auth.token.email in ['prathmeshojha2307@gmail.com'];
}
// Allow read/write access to plays collection for authenticated users
match /plays/{playId} {
allow read, write: if request.auth != null;
}
// Allow read/write access to favorites collection for authenticated users
match /favorites/{favoriteId} {
allow read, write: if request.auth != null;
}
}
}