-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.rules
More file actions
27 lines (23 loc) · 813 Bytes
/
storage.rules
File metadata and controls
27 lines (23 loc) · 813 Bytes
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
// Access to files through Firebase Storage is completely disallowed.
// Files may still be accessible through Google App Engine or GCS APIs.
service firebase.storage {
match /b/{bucket}/o {
function lessThan5Mb() {
return request.resource.size < 5 * 1024 * 1024
&& request.resource.contentType.matches('image/.*');
}
match /{allPaths=**} {
allow read, write: if false;
}
// // trying to get database
// match /images/sessions/{sessionId} {
// // get()
// allow read: if true;
// allow write: if request.auth.uid == get(firestore).data.owner.uid;
// }
match /images/{uid}/sessions/{sessionId}/{fileName} {
allow read: if true;
allow write: if request.auth.token.isTeacher == true && request.auth.uid == uid && lessThan5Mb();
}
}
}