Skip to main content

Hello,

 

I have a method in my K2 Helper class that updates process data fields. Method works successfully only if all users have been granted "Admin" permissions, otherwise it fails with error message --> "ClientException: 28019 K2::Domain]]User] does not have permissions to update the process" at line "processInstance.Update();"

 

here is my method:

 

public void UpdateDataFields(string serialNumber, Dictionary<string, object> dataFields)
{
if (!dataFields.Any())
{
Logger.Trace("There are no data fields provided to update.");
return;
}

var worklistItem = this.connection.OpenWorklistItem(serialNumber);
var processInstance = worklistItem.ProcessInstance;
var processDataFields = processInstance.DataFields.Cast<DataField>().ToList();
foreach (var dataField in dataFields)
{
var processDataField = processDataFields.SingleOrDefault(d => d.Name == dataField.Key);
if (processDataField != null)
{
processDataField.Value = dataField.Value;
}
}

processInstance.Update();
}

 

 

I'm enabling impersonation in my ASP.NET web application and want to just give the users "View & View Participate" permissions.

 

Thanks

Ramy Essam

Do the logon user has rights to access the task? If not, you may need to impersonate as an admin user.


Thanks brian-teo for your reply. Yes, users getting the tasks have "View and View Participate" permissions, the problem is updating the process with data fields requires an admin rights which it's not sense to give all domain users admin permissions to be able to update process data fields while they performing their actions.


Reply