Mahjooob
Rookie

assign role using smartobject ?

Jump to solution

HI,

 

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

 

Is there any SmartObject can do that ??

 

 

Thanks
Mahjooob

0 Kudos
Reply
2 Replies
khanh1
Apprentice

Re: assign role using smartobject ?

Jump to solution

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.


6058i4742CA06BB03BD57.png


 


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:DENALLIX\Administrator","Type":"User","DisplayName":null},{"Name":"K2:DENALLIX\Codi","Type":"User","DisplayName":null}]


 


6059i90E07352AAD24CBD.png

Reply
Mahjooob
Rookie

Re: assign role using smartobject ?

Jump to solution

many thanks, 

0 Kudos
Reply