Solved

assign role using smartobject ?


HI,

 

how I can assign a role to the user using a custom app.

 

Is there any SmartObject can do that ??

 

 

Thanks
Mahjooob

icon

Best answer by khanh1 17 May 2018, 17:46

View original

2 replies

Userlevel 6
Badge +16

Hi,


 


I haven't fully tested it yet but you can try to use the User Role SmartObject under System category to get around. (SmartObjects > System > Management > Users > SmartObjects > User Role). This system smartObject is making use of the Workflow Management API, you will need Server Admin right in K2 Management site to perform this task.


 


 1) Execute User Role SmartObject 's Load Role method to obtain the returned properties. These will need it for later step.



 


2) To add additional user to the role, update the UserRoleItems property similar to the one below by execute the Update Role method.


[{"Name":"K2:DENALLIXAdministrator","Type":"User","DisplayName":null},{"Name":"K2:DENALLIXCodi","Type":"User","DisplayName":null}]


 


many thanks, 

Reply