Skip to main content

Hi, 

 

We are tring to create a Group permission against the Process by using UpdateProcGroupPermissions , however, we noticed that 

it removes an existing Group permissions defined againt the Process and just add a new one.

 

For example. if we already have 2 Group permissions (A & 😎 then when we add the third (C) then it system removs the first two and

add the third one, which I was not expecting. My understanding is that it should check and just add the third one only (C) as others already exists.

 

Could you please let us know if this is the behaviour how it works OR is there any way that can help us to create a new one without deleting an existing ones?

 

Additionally, instead of using "UpdateProcGroupPermissions" function I have also tried through "UpdateProcPermissions" method and passing False 

for "Remove" argument but it does not create a new Group Permissions.

 

Finally, how do set the ProcSetPermission object  as GROUP entry (NOT USER). Thanks 

 

Code I am using to create is as follows:

------------------------------------------------------------

Dim objPermissionsToCreate As New Permissions

Dim objPermissionToCreate As New ProcSetPermissions()
objPermissionToCreate.ProcSetID = K2Process.ProcSetID
objPermissionToCreate.GroupName = String.Format("{0}:{1}", strSelectedK2SecurityLabel, ROLENAME)
objPermissionToCreate.Admin = True
objPermissionToCreate.View = True
objPermissionToCreate.ViewPart = True
objPermissionToCreate.Start = True
objPermissionToCreate.ServerEvent = True

 

objPermissionsToCreate.Add(objPermissionToCreate)

 

bolResult = ManagerServer.UpdateProcGroupPermissions(K2Process.ProcSetID, objPermissionsToCreate)

 

 

 

From this example:


 


https://www.k2.com/onlinehelp/k2blackpearl/devref/current/default.htm#Manage_Process.html


 


It looks like there are two classes:


 


Permissions permissions = new Permissions(); 
ProcSetPermissions procPermissions = new ProcSetPermissions();

It looks likes the 'Permissions' class may be the collection of 'ProcSetPermissions'.  Perhaps you need to do a read of the current process rights to this object first, before checking/adding new rights.


Thank you for your reply

 

I forgot to add the following line in the source code that I sent in the question (question has been updated).

 

Questions I have raised were two.

 

1- How to add a new value without deleting an existing records

2- How to set "ProcSetPermissions" object to indicate it is GROUP record (NOT USER Record). I have already set the GroupName and though that

"ProcSetPermissions" would be intelligent enough to understand that I am creating GROUP record (NOT USER RECORD) but this is not the case.

So wondering how to indicate it as a GROUP record.

 

Any help would be appreciated. Thanks.

 

CODE

---------------------------------------

 

Dim objPermissionsToCreate As New Permissions

Dim objPermissionToCreate As New ProcSetPermissions()
objPermissionToCreate.ProcSetID = K2Process.ProcSetID
objPermissionToCreate.GroupName = String.Format("{0}:{1}", strSelectedK2SecurityLabel, ROLENAME)
objPermissionToCreate.Admin = True
objPermissionToCreate.View = True
objPermissionToCreate.ViewPart = True
objPermissionToCreate.Start = True
objPermissionToCreate.ServerEvent = True

 

objPermissionsToCreate.Add(objPermissionToCreate)

 

bolResult = ManagerServer.UpdateProcGroupPermissions(K2Process.ProcSetID, objPermissionsToCreate)

 

 


Hi

 

This was a long time ago.. so probably not an issue anymore. .. but for anyone else reading this problem.

 

Use the UpdateProcPermissions method and set the 'objPermissionToCreate' .Type to..

 

0 = User

1 = Group

 

so...

objPermissionToCreate.Type = 0 //User

objPermissionToCreate.Type = 1 //Group

 

Cheeers

 

Bill


Reply