-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathauthorization-rules.yml
333 lines (289 loc) · 7.98 KB
/
authorization-rules.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
# ======================================
# Authorization Rules Configuration File
# ======================================
#
# This file contains a list of rules to authorize or protect
# granular changes in ZObjects.
#
# The Authorization strategy calculates all the atomic diff
# operations and tries to match each of them with the rules
# described in this file. When one of the rules matches the
# diff, the Authorization service collects the user rights
# required as per the matching rule and returns.
#
# Only the first matching rule is returned, so the order in
# the rules in this files is important; the most specific
# patterns should be detailed on top, while the most generic
# ones should be at the end of the rule list so that, if
# nothing else matches, it falls back to those.
#
# For detailed documentation on granular edit authorization, see:
# https://www.mediawiki.org/wiki/Extension:WikiLambda/Granular_Edit_Authorization
# ===========================
# Allow rules for all objects
# ===========================
# Change object type
- path: '^Z2K2(\.Z1K1.*)?$'
filter: [ ZObjectFilterTypeChanged ]
operations:
any:
- wikilambda-edit-object-type
# =======================================
# Multilingual info rules for all objects
# =======================================
# Change object labels
- path: '^Z2K3\.Z12K1\.[1-9]\d*(\..*)?$'
operations:
any:
- wikilambda-edit-object-label
# Change object descriptions
- path: '^Z2K5(\.Z12K1\.[1-9]\d*.*)?$'
operations:
any:
- wikilambda-edit-object-description
# Change object alias
- path: '^Z2K4(\.Z32K1\.[1-9]\d*.*)?$'
operations:
any:
- wikilambda-edit-object-alias
# ============================================
# Multilingual info rules for particular types
# ============================================
# Change key labels of types
- path: '^.*\.Z3K3\.Z12K1\.[1-9]\d*(\..*)?$'
type: Z4
operations:
any:
- wikilambda-edit-key-label
# Change key labels of error types
- path: '^.*\.Z3K3\.Z12K1\.[1-9]\d*(\..*)?$'
type: Z50
operations:
any:
- wikilambda-edit-error-key-label
# Change input labels of functions
- path: '^.*\.Z17K3\.Z12K1\.[1-9]\d*(\..*)?$'
type: Z8
operations:
any:
- wikilambda-edit-argument-label
# =================================
# Rights for super-restricted types
# =================================
# Change boolean
- path: '^Z2K2\.(.*)?$'
type: Z40
operations:
any:
- wikilambda-edit-boolean
# Change unit
- path: '^Z2K2\.(.*)?$'
type: Z21
operations:
any:
- wikilambda-edit-unit
# ===========================
# Rights for restricted types
# ===========================
# Change language
- path: '^Z2K2\.(.*)?$'
type: Z60
operations:
any:
- wikilambda-edit-language
# Change programming language
- path: '^Z2K2\.(.*)?$'
type: Z61
operations:
any:
- wikilambda-edit-programming
# ======================
# Rights for enum values
# ======================
# Change an enum value
- path: '^Z2K2\.(.*)?$'
filter: [ ZObjectFilterIsEnumValue ]
operations:
any:
- wikilambda-edit-enum-value
# =======================================
# Rights for all other predefined objects
#
# These rights are terminal, so from now
# on, all following rules will be only
# applicable to user-contributed objects.
# =======================================
# Change any predefined function
- path: '^Z2K2(\..*)?$'
type: Z8
filter: [ ZObjectFilterInRange, null, Z10000 ]
operations:
any:
- wikilambda-edit-builtin-function
# Change any predefined object
- path: '^Z2K2(\..*)?$'
filter: [ ZObjectFilterInRange, null, Z10000 ]
operations:
any:
- wikilambda-edit-predefined
# =================================
# Rights for user-contributed types
# =================================
# Change type
- path: '^Z2K2\.(.*)?$'
type: Z4
operations:
any:
- wikilambda-edit-type
# ======================================
# Rights for user-contributed converters
# ======================================
# Change connected deserialiser
- path: '^Z2K2\.(.*)?$'
type: Z46
filter: [ ZObjectFilterIsConnectedConverter ]
operations:
any:
- wikilambda-edit-connected-converter
# Change connected serialiser
- path: '^Z2K2\.(.*)?$'
type: Z64
filter: [ ZObjectFilterIsConnectedConverter ]
operations:
any:
- wikilambda-edit-connected-converter
# Change deserialiser
- path: '^Z2K2\.(.*)?$'
type: Z46
operations:
any:
- wikilambda-edit-converter
# Change serialiser
- path: '^Z2K2\.(.*)?$'
type: Z64
operations:
any:
- wikilambda-edit-converter
# =====================================
# Rights for user-contributed functions
# =====================================
# Change the inputs of a running user-function
- path: '^Z2K2\.Z8K1(\..*)?$'
type: Z8
filter: [ ZObjectFilterIsRunnable ]
operations:
any:
- wikilambda-edit-user-function
- wikilambda-edit-running-function
- wikilambda-edit-running-function-definition
# Change the output type of a running user-function
- path: '^Z2K2\.Z8K2(\..*)?$'
type: Z8
filter: [ ZObjectFilterIsRunnable ]
operations:
any:
- wikilambda-edit-user-function
- wikilambda-edit-running-function
- wikilambda-edit-running-function-definition
# Connect and disconnect tests from a running user-function
- path: '^Z2K2\.Z8K3\.[1-9]\d*(\..*)?$'
type: Z8
filter: [ ZObjectFilterIsRunnable ]
operations:
any:
- wikilambda-edit-user-function
- wikilambda-edit-running-function
add:
- wikilambda-connect-tester
remove:
- wikilambda-disconnect-tester
change:
- wikilambda-connect-tester
- wikilambda-disconnect-tester
# Connect and disconnect implementations from a running user-function
- path: '^Z2K2\.Z8K4\.[1-9]\d*(\..*)?$'
type: Z8
filter: [ ZObjectFilterIsRunnable ]
operations:
any:
- wikilambda-edit-user-function
- wikilambda-edit-running-function
add:
- wikilambda-connect-implementation
remove:
- wikilambda-disconnect-implementation
change:
- wikilambda-connect-implementation
- wikilambda-disconnect-implementation
# Connect and disconnect tests from a non-running user-function
- path: '^Z2K2\.Z8K3\.[1-9]\d*(\..*)?$'
type: Z8
operations:
any:
- wikilambda-edit-user-function
add:
- wikilambda-connect-tester
remove:
- wikilambda-disconnect-tester
change:
- wikilambda-connect-tester
- wikilambda-disconnect-tester
# Connect and disconnect implementations from a non-running user-function
- path: '^Z2K2\.Z8K4\.[1-9]\d*(\..*)?$'
type: Z8
operations:
any:
- wikilambda-edit-user-function
add:
- wikilambda-connect-implementation
remove:
- wikilambda-disconnect-implementation
change:
- wikilambda-connect-implementation
- wikilambda-disconnect-implementation
# Fallback: all other changes on user-function
- path: '^Z2K2\.(.*)?$'
type: Z8
operations:
any:
- wikilambda-edit-user-function
# =========================
# Rules for implementations
# =========================
# Change implementation that's connected to a function
- path: '^Z2K2\.(.*)?$'
type: Z14
filter: [ ZObjectFilterIsAttached ]
operations:
any:
- wikilambda-edit-attached-implementation
# Change implementation that's not connected
- path: '^Z2K2\.(.*)?$'
type: Z14
operations:
any:
- wikilambda-edit-implementation
# ===============
# Rules for tests
# ===============
# Change test that's connected to a function
- path: '^Z2K2\.(.*)?$'
type: Z20
filter: [ ZObjectFilterIsAttached ]
operations:
any:
- wikilambda-edit-attached-tester
# Change test that's not connected to a function
- path: '^Z2K2\.(.*)?$'
type: Z20
operations:
any:
- wikilambda-edit-tester
# ==================================
# Fallback rules for edit any object
# ==================================
# Change zobject
- path: '^Z2K2(\..*)?$'
operations:
any:
- wikilambda-edit