Skip to main content

I'm currently building a custom management page for users to quickly FIND and manage their process instances as well as worklists for their respective processes. 


With that said, what is the best way to verify if they have administrator rights to a process?


I know that in order to use the SourceCode.Workflow.Management.dll, you need to have Admin rights on the Host Server.  This is why I am using a service account to make the connection, but need to verify if the logged on user has Administrator rights to the target process.

Figured it out using the following code:


public bool isAdmin(string username)
{
 bool retval = false;


 WorkflowManagementServer wms = new WorkflowManagementServer("BlackPearl Server", 5555);
           
 wms.Open();
 
 Permissions perms = wms.GetUserPermissions(username, true);
       
 foreach (ProcSetPermissions p in perms)
 {
  if (p.ProcessFullName.Equals("myprocessfullname") && p.Admin)
                {
                    retval = true;
                    break;
                }
        }
           
           
        return retval;
}


If the user is an Admin for the process it will return true.


Reply