This repository has been archived by the owner on Sep 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathstorage-private.rules
39 lines (39 loc) · 1.59 KB
/
storage-private.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
36
37
38
39
rules_version = "2";
service firebase.storage {
match /b/{bucket}/o {
match /applications {
match /{applicationId} {
match /image {
allow read: if // User domain
request.auth.token.email.matches('.*@domain\\.com$') && request.auth.token.email_verified;
allow write: if // Admin uids
request.auth.uid in [ ]
&&
(
// DELETE
request.resource == null
// PUT/UPDATE with these restrictions
|| (request.resource.size <= 2 * 1024 * 1024 && request.resource.contentType.matches('image/.*'))
)
;
}
match /versions {
match /{versionId} {
allow read: if // User domain
request.auth.token.email.matches('.*@domain\\.com$') && request.auth.token.email_verified;
allow write: if // Admin uids
request.auth.uid in [ ]
&&
(
// DELETE
request.resource == null
// PUT/UPDATE with these restrictions
|| (request.resource.size <= 100 * 1024 * 1024 && request.resource.contentType == 'application/vnd.android.package-archive')
)
;
}
}
}
}
}
}