-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
57 lines (57 loc) · 2.09 KB
/
Copy pathfirestore.rules
File metadata and controls
57 lines (57 loc) · 2.09 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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read: if request.auth.uid != null;
match /groups/{groupId} {
allow read, create, delete: if request.auth.uid != null;
}
}
match /groups/{groupId} {
allow read: if request.auth.uid != null;
allow create: if request.auth.token.professor;
allow create, delete: if request.auth.token.admin;
match /students/{studentId} {
allow read, create, delete: if request.auth.uid != null;
}
match /homework/{homeworkId} {
allow read: if request.auth.uid != null;
allow write: if request.auth.token.professor;
allow write, delete: if request.auth.token.admin;
match /users/{userId} {
allow read, create: if request.auth.uid != null;
allow delete: if request.auth.token.admin;
}
}
match /evaluations/{evaluationId} {
allow read: if request.auth.uid != null;
allow write: if request.auth.token.professor;
allow write, delete: if request.auth.token.admin;
match /questions/{document=**} {
allow read: if request.auth.uid != null;
allow create: if request.auth.token.professor;
allow create, delete: if request.auth.token.admin;
}
match /users/{document=**} {
allow read, write: if request.auth.uid != null;
allow delete: if request.auth.token.admin;
}
}
match /forums/{forumId} {
allow read, create: if request.auth.uid != null;
allow create, delete: if request.auth.token.admin;
match /replies/{replyId} {
allow read, write: if request.auth.uid != null;
allow delete: if request.auth.token.admin;
}
}
match /chat/{document=**} {
allow read, create: if request.auth.uid != null;
}
match /assistance/{document=**} {
allow read, write: if request.auth.token.professor || request.auth.token.admin;
allow delete: if request.auth.token.admin;
}
}
}
}