Forum Discussion
mvalerio24
2 years agoContributor
Updating Scenario Security in a Business Rule
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 l...
- 2 years ago
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
sudarshan
2 years agoNew 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
2 years agoContributor
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?
- ChrisR1ch1 year agoNew Contributor III
Curious if anyone found a way to access the ReadAndWrite Group?
- sudarshan1 year agoNew Contributor III
Yes, I was able to edit the ReadAndWrite group like this
Dim writeableMem As WritableMember = BRApi.Finance.Members.ReadWritableMemberNoCache(si,DimTypeId.Scenario,"Actual") If writeableMem IsNot Nothing writeableMem.ReadDataGroupUniqueID = BRApi.Security.Admin.GetGroup(si, "Administrators").Group.UniqueID writeableMem.ReadWriteDataGroupUniqueID = BRApi.Security.Admin.GetGroup(si, "Administrators").Group.UniqueID BRApi.Finance.MemberAdmin.SaveMemberInfo(si,True,writeableMem,False,Nothing,False,Nothing,TriStateBool.FalseValue) End If
Related Content
- 3 years ago