-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathstorage.rules
22 lines (22 loc) · 1.01 KB
/
storage.rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /personal-rs/{user}/projects/{project} {
allow get: if request.auth.uid == user;
allow create: if request.auth.uid == user
&& request.resource.contentType == "application/msgpack"
&& project.matches(".*\\.hom$")
&& firestore.exists(/databases/(default)/documents/personal-rs/$(user)/projects/$(project[0:project.size()-4]));
allow delete: if request.auth.uid == user
&& project.matches(".*\\.hom$")
&& firestore.exists(/databases/(default)/documents/personal-rs/$(user)/projects/$(project[0:project.size()-4]));
}
match /published-rs/{file=**} {
allow get: if true;
}
match /published-rs/{tag}/versions/new.hom {
allow create: if request.auth.uid == firestore.get(/databases/(default)/documents/published-rs/$(tag)).data.uid
&& request.resource.contentType == "application/msgpack";
}
}
}