ChrisR1chgov
4 months agoNew Contributor
Determine Workflow Profile Security Access in a Dashboard Extender Rule
I'm using the following code snippet in a Dashboard Extender Rule to loop through the list a of Workflow Profiles. However, the code fails, if the user does not have security access to a particular Workflow Profile, returned in the list. Is there a way I can get the list returned with security access applied, so the list only returns Workflow Profiles that the user has access to?
Dim profile As String = "text1 tag to match"
Dim wfProfileName As String = ""
Dim cubeRootInfo As WorkflowCubeRootInfo = BRApi.Workflow.Metadata.GetCubeRootInfo(si, si.WorkflowClusterPk.ProfileKey, True)
cubeRootCluster As New WorkflowUnitClusterPk(si.WorkflowClusterPk)
cubeRootCluster.ProfileKey = cubeRootInfo.CubeRootProfile.ProfileKey
Dim profileInfos As List(Of WorkflowProfileInfo) = BRApi.Workflow.Metadata.GetRelatives(si, cubeRootCluster, WorkflowProfileRelativeTypes.Descendants, WorkflowProfileTypes.BaseAndParentInputProfiles)
For Each profileInfo As WorkflowProfileInfo In profileInfos
Dim wfScenarioTypeID As Integer = BRApi.Workflow.General.GetScenarioTypeId(si, cubeRootCluster)
If profile = profileInfo.GetAttributeValue(WfScenarioTypeID,sharedconstants.WorkflowProfileAttributeIndexes.Text1)
wfProfileName = profileInfo.ToString
' brapi.ErrorLog.LogMessage(si," profileInfo.Name = " & profileInfo.ToString & " : Text1 = " & profileInfo.GetAttributeValue(WfScenarioTypeID,sharedconstants.WorkflowProfileAttributeIndexes.Text1))
End If
Next