Forum Discussion
- KrishnaValued Contributor
- cbriscoeContributor
Hi Krishna. We can also delete users and groups using Extender rules.
- cbriscoeContributor
HI Satish P
You can delete users and groups using Extender rules. Try this rule below. Have fun :).
Imports SystemImports System.DataImports System.Data.CommonImports System.IOImports System.Collections.GenericImports System.GlobalizationImports System.LinqImports Microsoft.VisualBasicImports System.Windows.FormsImports OneStream.Shared.CommonImports OneStream.Shared.WcfImports OneStream.Shared.EngineImports OneStream.Shared.DatabaseImports OneStream.Stage.EngineImports OneStream.Stage.DatabaseImports OneStream.Finance.EngineImports OneStream.Finance.DatabaseNamespace OneStream.BusinessRule.Extender.DeleteSecurityGroupsPublic Class MainClassPublic Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As ObjectTrySelect Case args.FunctionTypeCase Is = ExtenderFunctionType.UnknownDim secGroupsToDelete As New List(Of String)({"GroupA","GroupB","GroupC"})For Each secGroup As String In secGroupsToDeleteBRApi.Security.Admin.DeleteGroup(si,secGroup)BRAPi.ErrorLog.LogMessage(si, "Security Group '" & secGroup & "' deleted by rule.")NextEnd SelectReturn NothingCatch ex As ExceptionThrow ErrorHandler.LogWrite(si, New XFException(si, ex))End TryEnd FunctionEnd ClassEnd NamespaceRemeber - You tell the code what you want to delete by putting it in a Lookup transformation rule. - HenningValued Contributor II
Hi, were you able to do this? If not, here is how it works, just as Krishna said.
You can extract the XML file either with the option Krishna pointed out, or just extract directly to your local Downloads folder.
You need to extract the security group(s) you wish to remove a user from. In my case, if I delete the entire row with "TEST_USER_2", save and load the file into the system, the user is no longer assigned to the security group "MySecurityGroup". With RegEx (Regular Expressions), search and replace in large files is saving you a lot of time.
Of course, you can also use business rules to do this as cbriscoe pointed out as an alternative to doing this in the XML.
Related Content
- 2 years ago
- 7 months ago
- 11 months ago
- 2 months ago