Forum Discussion
hadi_r
4 years agoNew Contributor
Restricting access to force Consolidate
Hello,
is there a way to restrict users from force consolidating? Can we control who has access to force consolidate in the system?
Thanks,
Hadi
- 3 months ago
This is available in 9.2 , in the scenario dimension there is a security section to assign security groups to force calc/ translate/ Calculate group.
StigThronaes
8 months agoNew Contributor
Hi! I have tried this code but it seems it also restricts the user from running "standard" consolidate and also calculate and translate. How can I modify the code so it only restricts "Force Consolidate"?
Oscar
8 months agoContributor
the following will tell you if it's force consolidate:
Dim isForced As Boolean = args.inputs(2)
Then add to your nested code as required:
If( isForced )
.....
Else
.....
End If
- StigThronaes8 months agoNew Contributor
Thanks! It worked. However, it created another problem. I am no longer able to open the Task Scheduler (Business rule error). Is this a known issue? Once I deleted the wcfEventHandler business rule the Task Scheduler worked as normal again.
- Oscar8 months agoContributor
I simplified the business rule
Namespace OneStream.BusinessRule.WcfEventHandler.WcfEventHandler Public Class MainClass Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As WcfEventHandlerArgs) As Object Try Dim returnValue As Object = args.DefaultReturnValue args.UseReturnValueFromBusinessRule = False args.Cancel = False If ( args.IsBeforeEvent And ScenarioDimHelper.GetNameFromID(si, si.WorkflowClusterPk.ScenarioKey) = "Actual" And (args.OperationName = "Calculate" Or args.OperationName = "StartConsolidation") ) Then Dim isForced As Boolean = args.inputs(2) If( isForced ) Throw New XFException(si, New Exception("Force Cosolidation Not Allowed.")) Else Return returnValue End If End If Return returnValue Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function End Class End Namespace- StigThronaes8 months agoNew Contributor
That worked! Thanks! I of course had to add the section below before row 17 to also apply this logic on a specific security group.
If ( Not brapi.Security.Authorization.IsUserInGroup(si,"ForceConsolidate")) Thenargs.Cancel = True
Related Content
- 3 years ago
- 3 years ago