Updating Scenario Security in a Business Rule

mvalerio24
New Contributor III

I need to update the security on a scenario using a dashboard button, is this possible through a dashboard extender rule? Essentially a meeting will take place and certain scenarios will need to be locked down so no one can make changes besides the appropriate security group on the call. I will then need to change it back to the original security settings with a separate button once the meeting is over

1 ACCEPTED SOLUTION

sudarshan
New Contributor III

This is possible to do via a dashboard extender. Here's a sample,

'Pull the member info object of the scenario you are looking for
Dim objMemberInfo As MemberInfo = BRApi.Finance.Members.GetMemberInfo(si, DimType.Scenario.Id, "Budget", True)
 
Dim scenarioProperties As ScenarioVMProperties = objMemberInfo.GetScenarioProperties()
 
Dim objGroupInfo As GroupInfo = BRApi.Security.Admin.GetGroup(si, "Administrators")
 
scenarioProperties.ManageDataGroup.SetStoredValue(objGroupInfo.Group.UniqueID)
 
'Create new member object
Dim objMember As New Member(objMemberInfo.Member.MemberPk, objMemberInfo.Member.Name, objMemberInfo.Member.Description, objMemberInfo.Member.DimId)
objMemberInfo.Member = objMember
 
'Update the properites and save it
Dim memberPk As MemberPK = BRApi.Finance.MemberAdmin.SaveMemberInfo(si, objMemberInfo, True, True, False, False)

 

Thanks,

Sudarshan

View solution in original post

3 REPLIES 3

sudarshan
New Contributor III

This is possible to do via a dashboard extender. Here's a sample,

'Pull the member info object of the scenario you are looking for
Dim objMemberInfo As MemberInfo = BRApi.Finance.Members.GetMemberInfo(si, DimType.Scenario.Id, "Budget", True)
 
Dim scenarioProperties As ScenarioVMProperties = objMemberInfo.GetScenarioProperties()
 
Dim objGroupInfo As GroupInfo = BRApi.Security.Admin.GetGroup(si, "Administrators")
 
scenarioProperties.ManageDataGroup.SetStoredValue(objGroupInfo.Group.UniqueID)
 
'Create new member object
Dim objMember As New Member(objMemberInfo.Member.MemberPk, objMemberInfo.Member.Name, objMemberInfo.Member.Description, objMemberInfo.Member.DimId)
objMemberInfo.Member = objMember
 
'Update the properites and save it
Dim memberPk As MemberPK = BRApi.Finance.MemberAdmin.SaveMemberInfo(si, objMemberInfo, True, True, False, False)

 

Thanks,

Sudarshan

mvalerio24
New Contributor III

Awesome, thank you!

mvalerio24
New Contributor III

This seems to update the managedata security group. I don't see any option for updating the ReadandWrite group do you know if that is possible?