modernize delete-user-account
This commit is contained in:
parent
35ce4dc32e
commit
e648baf5bd
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
workflows:
|
||||
- create-user-add-to-vre
|
||||
# - create-user-add-to-vre
|
||||
# - group_deleted
|
||||
# - user-group_created
|
||||
# - user-group-role_created
|
||||
|
@ -8,7 +8,7 @@ workflows:
|
|||
# - invitation-accepted
|
||||
# - user-group_deleted
|
||||
# - user-group-role_deleted
|
||||
# - delete-user-account
|
||||
- delete-user-account
|
||||
# - role_deleted
|
||||
# - role_created
|
||||
# - add_role_policy_permission
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
"inputParameters" : [ "userid" ],
|
||||
"tasks" : [
|
||||
{
|
||||
"name": "LAMBDA_TASK",
|
||||
"name": "INLINE_TASK",
|
||||
"taskReferenceName": "init",
|
||||
"type": "LAMBDA",
|
||||
"type": "INLINE",
|
||||
"inputParameters": {
|
||||
"root_vo": "{{ root_vo }}",
|
||||
"keycloak": "{{ keycloak }}/${workflow.input.realm}",
|
||||
|
@ -18,7 +18,8 @@
|
|||
"liferay": "{{ liferay }}",
|
||||
"liferay_auth": "{{ liferay_auth }}",
|
||||
"keycloak_userid" : "${workflow.input.userid}",
|
||||
"scriptExpression": "return { 'decoded_root_vo' : $.root_vo.replace('%2F','/'), 'encoded_root_vo' : encodeURIComponent($.root_vo)}"
|
||||
"evluatorType" : "javascript",
|
||||
"expression": "function f(){ return { 'decoded_root_vo' : $.root_vo.replace('%2F','/'), 'encoded_root_vo' : encodeURIComponent($.root_vo)}} f()"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -107,13 +108,14 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"name": "LAMBDA_TASK",
|
||||
"name": "INLINE_TASK",
|
||||
"taskReferenceName": "build_delete_group_tasks",
|
||||
"type": "LAMBDA",
|
||||
"type": "INLINE",
|
||||
"inputParameters": {
|
||||
"evaluatorType" : "javascript",
|
||||
"groups" : "${lookup_lr_user_groups.output.body.*.groupId}",
|
||||
"userId" : "${lookup_lr_user_by_screenname.output.body.userId}",
|
||||
"scriptExpression": "inputs = {}; tasks = []; for(var i=0;i<$.groups.length;i++){tasks.push({'name': 'pyrest','type' : 'SIMPLE','taskReferenceName' : 'del-' + i});inputs['del-'+i] = {'url' : '${init.input.liferay}/user/unset-group-users?userIds=' + $.userId + '&groupId=' + $.groups[i],'method' : 'POST','headers' : {'Authorization' : 'Basic ' + '${init.input.liferay_auth}', 'Accept' : 'application/json'}}}; return { 'tasks' : Java.to(tasks, 'java.util.Map[]'), 'inputs' : inputs};"
|
||||
"expression": "inputs = {}; tasks = []; function f(){ for(var i=0;i<$.groups.length;i++){tasks.push({'name': 'pyrest','type' : 'SIMPLE','taskReferenceName' : 'del-' + i});inputs['del-'+i] = {'url' : '${init.input.liferay}/user/unset-group-users?userIds=' + $.userId + '&groupId=' + $.groups[i],'method' : 'POST','headers' : {'Authorization' : 'Basic ' + '${init.input.liferay_auth}', 'Accept' : 'application/json'}}}; return { 'tasks' : Java.to(tasks, 'java.util.Map[]'), 'inputs' : inputs}} f()"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -149,9 +151,9 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"name": "LAMBDA_TASK",
|
||||
"name": "INLINE_TASK",
|
||||
"taskReferenceName": "lr_final_task",
|
||||
"type": "LAMBDA",
|
||||
"type": "INLINE",
|
||||
"inputParameters" : {
|
||||
"scriptExpression" : "1 == 1"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue