How do I get state transition permission

Parents Reply
  • I have managed to figure it out and actually it works. so this is how it is supposed to work.

    var workflow = vault.WorkflowOperations.GetWorkflowAdmin(107);

    foreach(StateTransition stateTransition in workflow.StateTransitions)
    {
    if(stateTransition.FromState==137&&stateTransition.ToState==138)
    {
    AccessControlList acl = stateTransition.AccessControlList; // Display the ACL details
    foreach (AccessControlEntry accessControlEntry1 in acl)
    {
    if (accessControlEntry1.IsGroup)
    {

    var usergroup = vault.UserGroupOperations.GetUserGroup(accessControlEntry1.UserOrGroupID);
    foreach(var account in usergroup.Members)
    {
    var userid = vault.UserOperations.GetLoginAccountOfUser(Convert.ToInt16(account));
    if (userid.EmailAddress == useremail)
    {
    Console.WriteLine("Can transition");
    break;
    }

    }

    }
    else
    {
    Console.WriteLine(accessControlEntry1.UserOrGroupID);
    }
    }
    }

    }

Children
No Data