started work on role_created event

This commit is contained in:
dcore94 2021-03-23 18:59:56 +01:00
parent 8e46177f07
commit 2652e9c635
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@
"inputParameters": {
"role" : "${workflow.input.role}",
"vres" : "${get_all_vres.output.body}",
"scriptExpression": "inputs={};tasks=[];for(var i=0;i<$.vres.length;i++)vre=$.vres[i],tasks.push({name:'pyrest',type:'SIMPLE',taskReferenceName:'create_role'}),inputs['create_role']={url:'${init.input.keycloak_admin}/clients/' + vres.id + '/roles',body:{clientRole:true,name:$.role,description:''},method:'POST',headers:{Authorization:'Bearer ${authorize.output.body.access_token}','Content-Type':'application/json'}},tasks.push({name:'pyrest',type:'SIMPLE',taskReferenceName:'get_back_role'}),inputs['get_back_role']={url:'${create_role.output.headers.location}',method:'GET',headers:{Authorization:'Bearer ${authorize.output.body.access_token}',Accept:'application/json'}},tasks.push({name:'pyrest',type:'SIMPLE',taskReferenceName:'create_role_policy'}),inputs['create_role_policy_']={url:'${init.input.keycloak_admin}/clients/' + vre.id + '/authz/resource-server/policy/role',body:{name:$.role+'_policy',description:'',type:'role',logic:'POSITIVE',decisionStrategy:'UNANIMOUS',roles:[{id:${create_role.output.headers.location.split('/').pop()},required:true}]},method:'POST',headers:{Authorization:'Basic ${init.input.liferay_auth}',Accept:'application/json'}};return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};"
"scriptExpression": "inputs={};tasks=[];for(var i=0;i<$.vres.length;i++)vre=$.vres[i],tasks.push({name:'pyrest',type:'SIMPLE',taskReferenceName:'create_role'+i}),inputs['create_role'+i]={url:'${init.input.keycloak_admin}/clients/' + vres.id + '/roles',body:{clientRole:true,name:$.role,description:''},method:'POST',headers:{Authorization:'Bearer ${authorize.output.body.access_token}','Content-Type':'application/json'}};return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};"
}
},
{