-
Notifications
You must be signed in to change notification settings - Fork 3
/
database.rules.json
137 lines (128 loc) · 6.67 KB
/
database.rules.json
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// These rules grant access to a node matching the authenticated
// user's ID from the Firebase auth token
{
"rules": {
// Regra teste para lembrar como libera o acesso aos dados
"notifications": {
"$userUid": {
".write": "auth.uid != null && auth.uid == $userUid",
".read": "auth.uid != null && auth.uid == $userUid"
},
},
"sistemaEscolar": {
".write": false,
".read": false,
//".read": "auth.uid != null && auth.token.master == true || auth.token.secretaria == true"
"numeros": {
".write": "auth.uid != null && auth.token.master == true || auth.token.secretaria == true || auth.token.adm == true",
".read":"auth.uid != null && auth.token.master == true || auth.token.secretaria == true || auth.token.adm == true"
},
"chamados": {
".write": "auth.uid != null && auth.token.master == true",
".read":"auth.uid != null && auth.token.master == true"
},
"docsBoletos": {
".indexOn": "numeroDoc",
".write": "auth.uid != null && auth.token.master == true || auth.token.secretaria == true",
".read":"auth.uid != null && auth.token.master == true || auth.token.secretaria == true"
},
"infoEscola": {
".write": "auth.uid != null && auth.token.master == true || auth.token.secretaria == true",
".read":"auth.uid != null && auth.token.master == true || auth.token.secretaria == true || auth.token.adm == true || auth.token.professor == true || auth.token.aluno == true",
"calendarioGeral": {
".indexOn": "id"
}
},
"chats": {
".write": "auth.uid != null && auth.token.secretaria == true || auth.token.master == true || auth.token.adm == true || auth.token.professor == true",
".read":"auth.uid != null && auth.token.secretaria == true || auth.token.master == true || auth.token.adm == true || auth.token.professor == true"
},
"cursos" : {
".write": "auth.uid != null && auth.token.secretaria == true || auth.token.master == true || auth.token.adm == true || auth.token.professor == true",
".read":"auth.uid != null && auth.token.secretaria == true || auth.token.master == true || auth.token.adm == true || auth.token.professor == true"
},
"followUp": {
".write": "auth.uid != null && auth.token.master == true || auth.token.secretaria == true",
".read":"auth.uid != null && auth.token.master == true || auth.token.secretaria == true"
},
"updates": {
".write": "auth.uid != null",
".read":"auth.uid != null"
},
"alunos": {
".write": false,
".read":"auth.uid != null && auth.token.master == true || auth.token.secretaria == true",
"$registro": {
".indexOn": ["emailAluno", "emailResponsavelPedagogico", "emailresponsavelFinanceiro"],
".write": "(auth.token.aluno == true && auth.uid == $registro) || (auth.token.secretaria == true || auth.token.master == true)",
".read": "(auth.token.aluno == true && auth.uid == $registro) || auth.token.master == true || auth.token.secretaria == true"
}
},
"preMatriculas": {
".write": false,
".read":"auth.uid != null && auth.token.master == true || auth.token.secretaria == true",
"$registro": {
".indexOn": ["emailAluno", "emailResponsavelPedagogico", "emailresponsavelFinanceiro"],
".write": "(auth.token.aluno == true && auth.uid == $registro) || (auth.token.secretaria == true || auth.token.master == true)",
".read": "(auth.token.aluno == true && auth.uid == $registro) || auth.token.master == true || auth.token.secretaria == true"
}
},
"alunosDesativados": {
"$registro": {
".indexOn": ["emailAluno", "emailResponsavelPedagogico", "emailresponsavelFinanceiro"],
".write": "(auth.token.aluno == true && auth.uid == $registro) || (auth.token.secretaria == true || auth.token.master == true)",
".read": "(auth.token.aluno == true && auth.uid == $registro) || auth.token.master == true || auth.token.secretaria == true"
},
".write": "auth.uid != null && auth.token.master == true || auth.token.secretaria == true",
".read":"auth.uid != null && auth.token.master == true || auth.token.secretaria == true"
},
"ultimaMatricula": {
".write": false,
".read":"auth.token.secretaria == true || auth.token.master == true"
},
"turmas": {
".write": "auth.token.secretaria == true || auth.token.master == true",
".read":"auth.token.secretaria == true || auth.token.master == true",
"$turma": {
".write": "auth.token.professor == true || auth.token.master == true",
".read": "auth.token.aluno == true || auth.token.master == true || auth.token.secretaria == true",
"alunos": {
"$registro": {
".write": "auth.token.professor == true",
".read": "auth.token.professor == true || (auth.token.aluno == true && auth.uid == $registro)"
}
}
}
},
"listaDeUsuarios": {
".read": "auth.token.master == true",
".write": "auth.uid != null"
},
"aniversarios": {
".read": "auth.uid != null",
".write": "auth.uid != null"
},
"secretaria": {
"responsaveisAutorizados": {
".read": "auth.uid != null && auth.token.secretaria == true || auth.token.master == true",
".write": "auth.uid != null && auth.token.secretaria == true || auth.token.master == true",
".indexOn": "addResponsavelCpf",
},
},
"listaDeProfessores": {
".read": "auth.uid != null && auth.token.secretaria == true || auth.token.master == true || auth.token.adm == true",
".write": "auth.uid != null"
},
"notasDesempenho": {
".write": "auth.uid != null && auth.token.master == true || auth.token.secretaria == true || auth.token.professor == true",
".read":"auth.uid != null && auth.token.master == true || auth.token.aluno == true || auth.token.secretaria == true || auth.token.professor == true"
},
"usuarios": {
"$user_id":{
".write": "auth.uid == $user_id",
".read": "auth.uid != null"
}
}
},
}
}