-
-
Notifications
You must be signed in to change notification settings - Fork 81
/
UsersAndGroups.yml
334 lines (320 loc) · 21.9 KB
/
UsersAndGroups.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
# NB: user/create and user/update migration steps do not allow full manipulation of the user Content.
# Fe. they do not allow to set a value for the remote_id or to set values for the different Fields (attributes).
# The known workaround to that is to use 2 migration steps, one which creates/updates the User and one which
# creates/updates the related Content.
# See https://github.com/kaliop-uk/ezmigrationbundle/issues/191 for an example of how to do it.
-
type: user
mode: create
first_name: xyz
last_name: xyz
username: xyz
email: xyz
password: xyz. # NB: The given password string is the plaintext version; it will be automatically hashed in the cms. PLEASE DON'T LET CLEARTEXT PASSWORDS BE STORED IN YOUR SOURCE CODE VERSIONING SYSTEMS
user_content_type: xxx # Optional, Content Type identifier (defaults to 'user')
lang: xxx-YY # Optional, will fallback to default language if not provided (--default-language option or 'eng-GB' by default)
groups: [x, y, z] # The user group ID or IDs (Content IDs or its/their remote_ids as string) to put the user into
roles: [x, y, z] # The role names or ids to assign to the user
# The list in references tells the manager to store specific values for later use
# by other steps in the current migration.
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attribute # An attribute to get the value of for the reference.
# Supports user_id, email, enabled, login, groups_ids (the latter returns an array)
# The shorthand 'id' can be used instead of 'user_id'
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies
-
type: user
mode: update
match: # Only one of the following can be specified, to define which users to update
id: x # int|int[]
email: xyz # string|string[]
login: # string|string[]
usergroup_id: # string|string[]
or: # match any of the conditions below. *NB:* less efficient that using the array notation for a single condition
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition can be any of ones specified above, including 'and' and 'or'
and: # match all of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
# NB: if you need more complex matching conditions to select a set of users, you can achieve that using a slightly convoluted way:
# 1. use a content/load migration step to match the contents which represent your users
# 2. in that step, set an reference, of type array, where you store the content ids
# 3. in a second migration step, use a loop/over construct to iterate over the reference and
# the use as substep a user/update where you match based on user_id
# eg:
# -
# type: content
# mode: load
# match:
# contenttype_identifier: editor_user
# expect: many
# references:
# -
# identifier: editor_user_ids
# attribute: content_id
# -
# type: loop
# over: "reference:editor_user_ids"
# steps:
# -
# type: user
# mode: update
# match:
# user_id: "loop:value"
# password: publish
# attributes:
# first_name: "faker: firstName"
# last_name: "faker: lastName"
match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, email or login
email: xyz # Optional. NB: can only be set if the match definition latches a single user
password: xyz # Optional. NB: The given password string is the plaintext version; it will be automatically hashed in the cms. PLEASE DON'T LET CLEARTEXT PASSWORDS BE STORED IN YOUR SOURCE CODE VERSIONING SYSTEMS
enabled: true|false # Optional
# Optional, Group ID / list of group IDs (or its/their remote_ids) the user has to be a member of.
# The user will be removed from all groups that are not in the list
groups: [x, y, z]
# The list in references tells the manager to store specific values for later use by other steps in the current migration.
# NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step!
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attribute # An attribute to get the value of for the reference.
# Supports user_id, email, enabled, login, groups_ids (the latter returns an array)
# The shorthand 'id' can be used instead of 'user_id'
# 'count' can be used to set a reference to the number of items matched
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change
# 'one': only one element should be matched; reference values will be scalars
# 'any': zero or more element should be matched; reference values will be arrays
# 'many': one or more element should be matched; reference values will be arrays
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies
-
type: user
mode: delete
match: # Only one of the following can be specified, to define which users to delete
id: x # int|int[]
email: xyz # string|string[]
login: # string|string[]
usergroup_id: # string|string[]
or: # match any of the conditions below. *NB:* less efficient that using the array notation for a single condition
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition can be any of ones specified above, including 'and' and 'or'
and: # match all of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
# NB: if you need more complex matching conditions to select a set of users, see user/update above
match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, email or login
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attribute # An attribute to get the value of for the reference.
# Supports user_id, email, enabled, login, groups_ids (the latter returns an array)
# The shorthand 'id' can be used instead of 'user_id'
# 'count' can be used to set a reference to the number of items matched
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies
-
type: user
mode: load
match: # Only one of the following can be specified, to define which users to delete
id: x # int|int[]
email: xyz # string|string[]
login: # string|string[]
usergroup_id: # string|string[]
or: # match any of the conditions below. *NB:* less efficient that using the array notation for a single condition
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition can be any of ones specified above, including 'and' and 'or'
and: # match all of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, email or login
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attribute # An attribute to get the value of for the reference.
# Supports user_id, email, enabled, login, groups_ids (the latter returns an array)
# The shorthand 'id' can be used instead of 'user_id'
# 'count' can be used to set a reference to the number of items matched
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies
-
type: user_group
mode: create
parent_group_id: x # The content ID of the user group to put the new group into, can be an array. Content remote_id(s) also supported.
name: xyz
description: xyz # Optional
roles: [x, y, z] # The role names or ids to assign to the group
remote_id: custom_remote_id # Optional, will set a custom remote id
section: x # string|int Optional section id or identifier
# The list in references tells the manager to store specific values for later use by other steps in the current migration.
# NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step!
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attribute # An attribute to get the value of for the reference.
# Supports: user_group_id, parent_user_group_id, users_ids (the latter returns an array)
# The shorthand 'id' can be used instead of 'user_group_id'
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies
-
type: user_group
mode: update
match: # Define which groups to update. Only one match condition at a time supported
id: x # int|int[]
content_remote_id: yyy # string|string[]
parent_usergroup_id: yyy # string|string[]
or: # match any of the conditions below. *NB:* less efficient that using the array notation for a single condition
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition can be any of ones specified above, including 'and' and 'or'
and: # match all of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
# NB: if you need more complex matching conditions to select a set of usergroups, see user/update above
match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, remote_id or parent id
name: xyz # Optional. Can only be used when the group to be updated is single
description: xyz # Optional
parent_group_id: x # Optional, the new parent user group ID or group's remote_id
lang: xxx-YY # Optional, will fallback to default language if not provided (--default-language option or 'eng-GB' by default)
remote_id: custom_remote_id # Optional, will set a custom remote id
section: x # string|int Optional section id or identifier
# The list in references tells the manager to store specific values for later use by other steps in the current migration.
# NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step!
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attribute # An attribute to get the value of for the reference
# Supports: user_group_id, parent_user_group_id, users_ids (the latter returns an array)
# The shorthand 'id' can be used instead of 'user_group_id'
# 'count' can be used to set a reference to the number of items matched
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change
# 'one': only one element should be matched; reference values will be scalars
# 'any': zero or more element should be matched; reference values will be arrays
# 'many': one or more element should be matched; reference values will be arrays
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies
-
# Note: The users which are not assigned to other groups will be deleted.
type: user_group
mode: delete
match: # Only one of the following can be specified, to define which groups to delete
id: x # int|int[]
content_remote_id: yyy # string|string[]
parent_usergroup_id: yyy # string|string[]
or: # match any of the conditions below. *NB:* less efficient that using the array notation for a single condition
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition can be any of ones specified above, including 'and' and 'or'
and: # match all of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
# NB: if you need more complex matching conditions to select a set of usergroups, see user/update above
match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, remote_id or parent id
# The list in references tells the manager to store specific values for later use by other steps in the current migration.
# NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step!
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attribute # An attribute to get the value of for the reference
# Supports: user_group_id, parent_user_group_id, users_ids (the latter returns an array)
# The shorthand 'id' can be used instead of 'user_group_id'
# 'count' can be used to set a reference to the number of items matched
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change
# 'one': only one element should be matched; reference values will be scalars
# 'any': zero or more element should be matched; reference values will be arrays
# 'many': one or more element should be matched; reference values will be arrays
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies
-
type: user_group
mode: load
match: # Only one of the following can be specified, to define which groups to delete
id: x # int|int[]
content_remote_id: yyy # string|string[]
parent_usergroup_id: yyy # string|string[]
or: # match any of the conditions below. *NB:* less efficient that using the array notation for a single condition
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition can be any of ones specified above, including 'and' and 'or'
and: # match all of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, remote_id or parent id
# The list in references tells the manager to store specific values for later use by other steps in the current migration.
# NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step!
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attribute # An attribute to get the value of for the reference
# Supports: user_group_id, users_ids (the latter returns an array)
# The shorthand 'id' can be used instead of 'user_group_id'
# 'count' can be used to set a reference to the number of items matched
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change
# 'one': only one element should be matched; reference values will be scalars
# 'any': zero or more element should be matched; reference values will be arrays
# 'many': one or more element should be matched; reference values will be arrays
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies