This repository was archived by the owner on Jul 27, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.rules
More file actions
63 lines (59 loc) · 2.38 KB
/
Copy pathstorage.rules
File metadata and controls
63 lines (59 loc) · 2.38 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
// firestore.rules isAuthorized() 미러링 — 인증·이메일검증·impact7 도메인만.
function isAuthorized() {
return request.auth != null
&& request.auth.token.email_verified == true
&& request.auth.token.email.matches('.*@impact7\\.kr$');
}
// === impact7exam ===
match /exam-papers/{allPaths=**} {
allow read: if isAuthorized();
allow write: if isAuthorized();
}
match /scans/{allPaths=**} {
allow read: if isAuthorized();
allow write: if isAuthorized();
}
// === impact7HR ===
// H-01: HR 파일 I/O는 전부 callable(hrUpload*/hrGetFileUrl/hrDeleteFile, Admin SDK 우회)
// 경유로 전환됨 — HR 클라이언트엔 firebase/storage 사용이 전무하다. 클라이언트 직접 접근은
// 전면 차단(if false)하고, 역할·토큰·크기(<20MB)·MIME은 서버 callable이 강제한다.
// 실사용 Storage 경로: staff/{staffId}, contracts/, entities/{entityId}.
match /staff/{staffId}/{allPaths=**} {
allow read, write: if false;
}
match /contracts/{allPaths=**} {
allow read, write: if false;
}
match /entities/{entityId}/{allPaths=**} {
allow read, write: if false;
}
// 레거시(현재 Storage 미사용): 경비는 Firestore `expenses` 컬렉션, 서명은 Firestore에
// base64 data URL로 저장된다. 혹시 남은 옛 객체를 위한 방어용 차단으로만 유지.
match /expenses/{expenseId}/{allPaths=**} {
allow read, write: if false;
}
match /signatures/{allPaths=**} {
allow read, write: if false;
}
// === impact7newDSC ===
// 학생 기록 첨부(반성문/기타). 이미지 15MB 이하.
match /student-records/{studentId}/{recordId}/{fileName} {
allow read: if isAuthorized();
allow create, update: if isAuthorized()
&& request.resource.size < 15 * 1024 * 1024
&& request.resource.contentType.matches('image/.*');
allow delete: if isAuthorized();
}
// === impact7board ===
// 칸반 카드 첨부파일(자료 공유). 20MB 이하.
match /board_attachments/{cardId}/{fileName} {
allow read: if isAuthorized();
allow create, update: if isAuthorized()
&& request.resource.size < 20 * 1024 * 1024;
allow delete: if isAuthorized();
}
}
}