What IMPORT should i use for the SECURITY updates for BRApi
Hi All,
i am new to OneStream, i tried creating BR for Security automation. below is my entire code in OS-BR.
Imports System
Imports System.Collections.Generic
Imports System.Data
Imports System.Data.Common
Imports System.Globalization
Imports System.IO
Imports System.Linq
Imports Microsoft.VisualBasic
Imports OneStream.Finance.Database
Imports OneStream.Finance.Engine
Imports OneStream.Shared.Common
Imports OneStream.Shared.Database
Imports OneStream.Shared.Engine
Imports OneStream.Shared.Wcf
Imports OneStream.Stage.Database
Imports OneStream.Stage.Engine
Namespace OneStream.BusinessRule.Finance.BR_UserManagement
Public Class SecurityGroupHelper
Public Sub ShowQAGroups(ByVal si As SessionInfo, ByVal api As FinanceRulesApi)
Try
' Get all security groups using the API passed to the function
Dim allGroups As GroupInfo = BRApi.Security.Admin.GetGroup(si, "QA_Admin")
' Loop through all groups and display a MessageBox for each that starts with "QA_"
For Each grp As MemberInfo In allGroups
If grp.Member.Name.StartsWith("QA_") Then
MessageBox.Show(grp.Member.Name, "QA Group Found")
End If
Next
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Sub
End Class
End Namespace
---------------------------------------------------------------------------------------
I am getting error as below. i am not sure what mistake in the code. one i am sure about messagebox.show.
Error compiling Business Rule 'BR_UserManagement'.
1) Error at line 27: Expression is of type 'GroupInfo', which is not a collection type.
2) Error at line 29: 'MessageBox' is not declared. It may be inaccessible due to its protection level.