Forum Discussion
I do not believe there is a way to only return the profiles a user has access to. You would need to loop through the Profiles and bring in the AccessGroup and MaintenanceGroup IDs then check if the user is in that group using BRApi.Security.Authorization.IsUserInGroup(si, groupID). Before the loop create a new List (Of WorkflowProfileInfo) object and add the Workflow Profile Infos to it if the conditions are met.
I'm having a problem getting a list of all workflow profiles, to be able to loop through and pull Access Group and Maintenance Group. Can you give me or direct me to a snippet of code that will return that list.
- KarlT8 months agoContributor III
This function should help
BRApi.Workflow.Metadata.GetRelatives(si, cubeRootCluster, WorkflowProfileRelativeTypes.Descendants, WorkflowProfileTypes.BaseAndParentInputProfiles)
- jayaleck3 days agoNew Contributor II
Not sure if you were able to get your list, found this thread looking for something else... But here's something I did to loop through profiles and lock them,
Dim wfClusterPk = BRAPi.Workflow.General.GetWorkflowUnitClusterPk(si,wfName,ScenarioForStatus, WFTimeForStatus)Dim profileInfos As List(Of WorkflowProfileInfo) = BRApi.Workflow.Metadata.GetRelatives(si, BRAPI.Workflow.General.GetWorkflowUnitClusterPk _(si,wfName,ScenarioForStatus, WFTimeForStatus),WorkflowProfileRelativeTypes.Descendants,WorkflowProfileTypes.AllProfiles)For Each profileInfo In profileInfos'Brapi.ErrorLog.LogMessage(si,$"profileInfo - {profileInfo}")BRApi.Workflow.Locking.LockWorkflowUnit(si, wfClusterPk)BRapi.Workflow.Locking.LockWorkflowUnitDescendants(si, wfClusterPk, WorkflowProfileTypes.AllProfiles, wfChannelId)Next
Related Content
- 2 months ago
- 2 years ago
- 2 years ago