Skip to main content
Contributor
Jul 28, 2023 8:55 PM UTC
Solved

Application Security Role update with Business Rules

Is it possible to update the Application Security roles with in an extender Business rule? I want to be able to update the Modifydata role with the push of a button.

photonAnswer
Contributor
Jul 31, 2023 9:29 PM UTC

I've been able to update security groups without an IIS reset using a BR, here are the relevant pieces:

Dim objMember As WritableMember = BRApi.Finance.Members.ReadWritableMemberNoCache(si, DimType.Entity.Id, memberName)

objMember.ReadDataGroupUniqueID = BRApi.Security.Admin.GetGroup(si,groupName).Group.UniqueID

BRApi.Finance.MemberAdmin.SaveMemberInfo(si, True, objMember, False, properties, False , descriptions, TriStateBool.FalseValue)

 We've had this running on a nightly schedule to keep our descriptions up to date with MDM but it could be hooked to a button press just the same. I don't know how it compares to Jack's method and his certainly looks simpler but maybe it will be of some use.

13 replies

Employee - Sage
Jul 31, 2023 9:18 AM UTC

It's OneStream, of course it's possible 😎

Check out BRApi.Security.Admin.GetRole and .SaveRole.

RobbSalzmann
Employee - Advisor
Employee - Advisor
Jul 31, 2023 12:53 PM UTC

Thanks JackLacava .  To put a little more structure around this, the requirement is to lock a scenario (using a button) for a period of time, then set it back to its original access with another button.

Use Case:
An all day meeting with the CFO commences to discuss and refine a forecast.  During this meeting the scenario needs to be locked down to prevent a potential moving target, changing values.  When the meeting is over the scenario is opened back up and FAs are given tasks to update the forecast.
The admin wants a simple set of on/off buttons to accomplish the locking/unlocking of the scenario.

Jul 31, 2023 1:57 PM UTC

Would locking/unlocking the workflow not be a valid approach for this?

photonAnswer
Contributor
Jul 31, 2023 9:29 PM UTC

I've been able to update security groups without an IIS reset using a BR, here are the relevant pieces:

Dim objMember As WritableMember = BRApi.Finance.Members.ReadWritableMemberNoCache(si, DimType.Entity.Id, memberName)

objMember.ReadDataGroupUniqueID = BRApi.Security.Admin.GetGroup(si,groupName).Group.UniqueID

BRApi.Finance.MemberAdmin.SaveMemberInfo(si, True, objMember, False, properties, False , descriptions, TriStateBool.FalseValue)

 We've had this running on a nightly schedule to keep our descriptions up to date with MDM but it could be hooked to a button press just the same. I don't know how it compares to Jack's method and his certainly looks simpler but maybe it will be of some use.

Contributor
Aug 1, 2023 12:39 PM UTC

I actually got something similar to work last night! This is great tho, thanks for sharing!