Skip to main content

Hi

 

Simple question.  

 

I want to know if I can write a SQL script to assign rights against a workflow, rather than entering manually.

 

Which SQL table contains the users that have been assigned rights to workflows (so that they can do actions such as start, view etc.)?

 

Ideally, I don't want to create active directory groups to mass assign users.

 

To provide context, I am doing this on our development environment for testing purposes.

 

 

Thanks.

 

 

Hello  @ConradMc ,


 


If you are actually interested in K2 roles, not AD groups, have a look at the Get Role Users method of the UMUser SmartObject.


 


But to answer the question you asked, roles also appear in the Identity.Identity table in the K2 db.  You need to cross reference with the Identity.IdentityMember table to determine membership.  It should be noted that this will get you cached role membership.  If role membership recently changed, K2 may not have updated its identity cache (these tables) to reflect this change


 


Please also have a glimpse at this thread:https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/SQL-Query-to-report-on-K2-Role-membership/td-p/63526


I am interested in a solution to this problem as well - I can't tell you how many times I've deployed a K2 package to Test/Stage/prod that had a new workflow process that I neglect to give anyone rights to start. Having such a thing be scriptable would make it easier to remember.


Hi there  @ConradMc 


 


I researched this issue managed to find the SQL Table that contains the users that have been assigned rights to workflows. 


 


note for you to assign a new user you will need the process Id which you will find from the Procset table


 


have a look on the attachments .


 


I hope this is helpful!


 


regards 


HulisaniN




@HulisaniN  this is spot on. Also  @KagisoMasha thanks for you help.

 

 

Update: I may put something on the K2 ideas site, it would be handy to copy rights from one workflow to another (within K2 Management). I have a workflow that calls another workflow so it is imperative both workflows will have the same rights on both.


@ConradMc 


 


That will be nice feature for child workflow to  inherit the rights of parent workflows. 


 


I will look up for the idea in K2 ideas site to give a vote :)


I agree - the old K2 Workspace had a node under "Users" that allowed you to apply the same rights to multiple workflow processes at once which was very handy. Now I have no recourse but to do one at a time, which is painful when setting up a new K2 environment. Share the link to the idea and I will heartily endorse it.


Reply