-
Notifications
You must be signed in to change notification settings - Fork 0
/
firestore.rules
35 lines (29 loc) · 1.22 KB
/
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
35
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{user} {
allow read, create: if request.auth.uid != null;
allow update, delete: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == "master";
}
match /albums/{albumId} {
allow read: if request.auth.uid != null;
allow create, update, delete: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == "editor";
}
match /albums/{albumId}/songs/{songId} {
allow read: if request.auth.uid != null;
allow create, update, delete: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == "editor";
}
match /published_albums/{id} {
allow read: if true;
allow create, update, delete: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == "editor";
}
match /published_albums/{albumId}/songs/{songId} {
allow read: if true;
allow create, update, delete: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == "editor";
}
// homepage
match /data/{accuessCount} {
allow read, update: if true;
}
}
}