This repository has been archived by the owner on Jul 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmock.yml
402 lines (392 loc) · 10.8 KB
/
mock.yml
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
- fields:
people:
required:
- email
- nickname
header: [nickname, firstname, lastname, city, gender, mobile, email]
form:
- title: Persoon
fields:
- [nickname]
- [firstname, infix, lastname]
- [gender]
- [birthdate,deathdate]
- title: Adres
fields:
- [street,housenumber]
- [zipcode,city]
- [country]
- title: Bank
fields:
- [iban]
- [directdebit]
- [email]
- [mobile]
- [phone]
- [emergencyinfo]
- title: Status
fields:
- [membertype, roles]
- [membersince,membertill]
- [functions]
- [notes]
- [wantscontact]
- title: Sleutel
fields:
- [keycode]
- [coasters]
- [cashregister]
- [frontdoor]
- [isadmin]
- title: System
fields:
- [passwordhash]
properties:
gid: {}
id: {}
birthdate:
type: date
title: Geboortedatum
boardnotes: {}
cashregister:
type: boolean
title: Kassasysteem
city:
type: string
title: Woonplaats
coasters:
type: boolean
title: Viltjes
country:
type: string
title: Land
deathdate:
type: date
title: Sterfdatum
directdebit:
type: array
title: Overboeking
email:
pattern: /^.*@.*$/
emergencyinfo:
type: string
title: Noodgeval info
favoritenumber: {}
firstname:
type: string
title: Voornaam
frontdoor:
type: boolean
title: Voordeur
functions:
type: array
title: Functies
gender:
type: enum
title: Geslacht
options:
male: Man
female: Vrouw
trans: Trans
other: Anders
housenumber:
type: string
title: Huisnummer
iban:
type: string
title: IBAN
infix:
type: string
title: Tussenvoegsel
isadmin:
type: boolean
title: Admin
keycode:
type: string
title: KeyCode
lastname:
type: string
title: Achternaam
membersince:
type: string
title: Lid sinds
membertill:
type: string
title: Lid tot
membertype:
type: string
title: Lid type
mobile:
type: string
title: Mobiel
nickname:
type: string
title: Bijnaam
notes:
type: string
title: Opmerkingen
password_hash:
type: string
title: Wachtwoord
peoplesince: {}
phone:
type: string
title: Telefoon
privatenotes: {}
roles:
type: reference
target: roles
title: Groepen
displayValue: name
state: {}
street:
type: string
title: Straat
wantscontact:
type: boolean
title: Wil contact
zipcode:
type: string
title: Postcode
roles:
title: Wijzig groep
header: [name,description]
form:
- title: Gegevens
fields:
- [name]
- [description]
properties:
gid: {}
id: {}
description:
type: string
title: Omschrijving
members:
type: reference
target: people
title: Leden
displayValue: nickname
name:
type: string
title: Naam
people_roles:
properties:
name:
type: string
title: Naam
gid: {}
id: {}
people_id: {}
roles_id: {}
fields:
title: Wijzig veld
form:
- title: Veld
fields:
- [name]
- [title]
- [type]
properties:
name:
name: name
title: Naam
type: string
readonly: true
type:
name: type
title: Type
type: option
options:
string: Tekst
option: Optie
enum: Dropdown
date: Datum
array: Lijst
boolean: Booleaan
link: Link
title:
name: title
title: Label
type: string
target:
name: target
title: Doel
type: string
displayValue:
name: displayValue
title: Weergegeven veld
type: string
options:
name: options
title: Opties
type: array
- people:
- email: [email protected]
password: '1234'
phone: '+31152121516'
nickname: Admin
- email: [email protected]
password: '1234'
phone: '+31152121516'
nickname: Wikkert
firstname: Willem
infix: van
lastname: Olbodo
street: Verwersdijk
housenumber: 102
zipcode: 2611NK
city: Delft
country: The Netherlands
gender: male
mobile: +31600000001
iban: NL12NOBANK123123123123
birthdate: 1939-04-14
deathdate: 2029-04-14
emergencyinfo: Niet reanimeren!
membertype: member
peoplesince: 1959-04-14
functions: [commissieX]
notes: Al 60 jaar stand-bye!
favoritenumber: 42
wantscontact: yes
keycode: 123123
coasters:
authentication: [pincode,key,fingerprint]
balancetopup: 20.00
cashregister: true
frontdoor:
timelimits:
- from: '16:00'
to: '02:00'
days: [monday,thursday]
directdebit: [contribution, coasters]
- email: [email protected]
phone: '+31600000001'
nickname: Sammy
firstname: Sam
lastname: Anonymous
street: Verwersdijk
housenumber: 104
zipcode: 2611NK
city: Delft
country: The Netherlands
gender: trans
iban: NL12NOBANK123123123132
birthdate: 1989-04-14
peoplesince: 2010-01-01
functions: [boardmember, eettafel]
keycode: 321321
coasters: null
cashregister: true
frontdoor: true
directdebit: [contribution]
password: '1234'
- email: [email protected]
nickname: Keymaster
phone: '+31152121516'
- email: [email protected]
nickname: AIVD
- roles:
- name: login
- name: self
members: []
- name: admin
members: [[email protected]]
- name: board
members: [[email protected]]
- name: member
members: [[email protected], [email protected]]
- name: solvable
members: [[email protected]]
- name: oldmember
members: []
- name: keymanager
members: [[email protected]]
- name: keyobserver
members: [[email protected]]
- permissions:
# Permission types:
# 'view', 'edit', 'create', 'custom'
# fields:
# type, ref_table, ref_key, ref_value
- table: [people, roles, people_roles, fields]
type: [view, edit, create]
description: Allows editing properties on resources (Should be autogenerated on field create)
key: fields
value: |
SQL(
INNER JOIN (SELECT id, ref_table FROM fields) values
ON values.ref_table = tables.ref_table
)
- table: [people, roles, people_roles, fields, permissions]
type: create
description: Allows creating resources (Created initially)
- table: people_roles
type: create
description: Allows assigning people to roles. (Should be autogenerated on role create)
key: roles_id
value: SQL(CROSS JOIN (SELECT id FROM roles) values)
# - table: roles_permissions
# type: create
# description: Allows assigning permissions roles. (Should be exposed via API)
# key: roles_id
# value: SQL(CROSS JOIN (SELECT id FROM roles) values)
- roles_permissions:
# roles_permission: META
# autogenerated dingen
# CREATE fields -> CREATE permissions (create, view, edit)
# - GRANT ALL to $role WITH fields::create permissions
# CREATE role -> CREATE PERMISSIONS (people_roles::create(roles_id=role.id))
# - GRANT to $role WITH role::create permissions
# Permission grants. (On creating records in roles_permissions)
# - Grant field permissions when <resource>::create permissions
# - Grant global create permissions only as admin
login:
people:
view: [email, firstname, gid, id, infix, lastname, nickname, phone, roles]
people_roles:
# !! These were matched by the mock script, review these please.
view: [gid, id, name, people_id]
roles:
view: [gid, id, members, name]
self:
people:
edit: [city, coasters, country, directdebit, email, emergencyinfo, favoritenumber, gender, housenumber, iban, mobile, notes, password_hash, phone, privatenotes, state, street, zipcode]
view: [city, coasters, country, directdebit, email, emergencyinfo, favoritenumber, gender, housenumber, iban, mobile, notes, phone, privatenotes, state, street, zipcode]
admin:
people:
edit: [password_hash, roles]
people_roles:
# TODO, Parse these type of create permissions (even fix their definition).
create:
roles: [board, member, keymanager, keyobserver]
roles:
edit: [members]
board:
people:
create: {}
edit: [birthdate, boardnotes, cashregister, city, country, deathdate, directdebit, email, emergencyinfo, firstname, frontdoor, functions, gender, housenumber, iban, infix, lastname, membertype, mobile, nickname, notes, peoplesince, phone, state, street, zipcode]
view: [birthdate, boardnotes, cashregister, city, country, deathdate, directdebit, email, emergencyinfo, firstname, frontdoor, functions, gender, housenumber, iban, infix, lastname, membertype, mobile, nickname, notes, peoplesince, phone, state, street, zipcode]
people_roles:
create:
roles: [board, member, keymanager, keyobserver]
edit: [name]
roles:
create: {}
edit: [description, name]
member:
people:
view: [city, country, emergencyinfo, favoritenumber, functions, housenumber, membertype, mobile, notes, peoplesince, state, street, zipcode]
people_roles:
view: [name]
roles:
view: [description, name]
keymanager:
people:
edit: [cashregister, frontdoor, keycode]
view: [cashregister, frontdoor, keycode]
keyobserver:
people:
view: [cashregister, frontdoor, keycode]