Using Kentico 11.0.26. How do I select this option programatically when creating a workflow using Workflow API
EDIT: After running the code sample in link above, the very first radio button "None" gets selected. If you go to Kentico and manually select "Only listed" option, the role added programatically appears.
You can achieve that with the code sample that you already linked in your post. That settings is placed directly on the step itself, so with code like this you should set it:
// Here Only listed security is assigned to current step.
step.StepRolesSecurity = WorkflowStepSecurityEnum.OnlyAssigned;
EDIT:
Additionally save workflow step after update StepRolesSecurity property:
WorkflowStepInfoProvider.SetWorkflowStepInfo(step);