-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
31 lines (28 loc) · 1.04 KB
/
firestore.rules
File metadata and controls
31 lines (28 loc) · 1.04 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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
// spacekatb@gmail.com 계정은 모든 데이터에 접근 가능
allow read, write: if request.auth != null &&
request.auth.token.email == 'spacekatb@gmail.com';
}
match /habits/{userId}/{document=**} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
match /exercises/{document=**} {
allow read, write: if request.auth != null && (
request.auth.token.email == 'spacekatb@gmail.com' ||
request.auth.uid == resource.data.userId ||
request.auth.uid == request.resource.data.userId
);
}
match /weeklyGoals/{goalId} {
allow read, write: if request.auth != null && (
request.auth.token.email == 'spacekatb@gmail.com' ||
goalId.matches(request.auth.uid + '_.*') ||
resource.data.userId == request.auth.uid ||
request.resource.data.userId == request.auth.uid
);
}
}
}