-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.rules
More file actions
25 lines (23 loc) · 846 Bytes
/
storage.rules
File metadata and controls
25 lines (23 loc) · 846 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
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
// Profil resimleri
match /profilePictures/{userId}/{allPaths=**} {
// Sadece kendi profil resmini yükleyebilir
allow read: if true; // Herkes okuyabilir
allow write: if request.auth != null && request.auth.uid == userId
&& request.resource.size < 2 * 1024 * 1024 // Max 2MB
&& request.resource.contentType.matches('image/.*');
}
// Event resimleri (gelecekte kullanılabilir)
match /eventImages/{eventId}/{allPaths=**} {
allow read: if true;
allow write: if request.auth != null
&& request.resource.size < 5 * 1024 * 1024; // Max 5MB
}
// Diğer tüm dosyalara erişim yok
match /{allPaths=**} {
allow read, write: if false;
}
}
}