Appcontext persists if APP-B inherits APP-A, shares the ruleset, uses unscoped DSS/settings, or relies on requestor-level context instead of thread-level isolation during application switching- implies its an expected behaviour.
I could thnk of below approaches:
Scope the toggle to the right application :Use Application Settings and own them in APP-A’s ruleset. Read via D_pxGetApplicationSettingValue so the value resolves in the current app and is not editable outside APP-A.
Control who can edit even if users can see it :Put the editable rule/UI in an APP-A production ruleset and delegate it only through APP-A’s access group. That way, when the operator switches to APP-B, the higher-ranked unlocked production ruleset for APP-A is no longer in the active list, so editing isn’t possible.
Privilege based restrictions: Add a privilege to the edit section/flow action and grant it only in APP-A roles. If APP-B is built on APP-A and must inherit the read-only toggle, privilege still blocks edits from APP-B.
Update the auto generated when rule to include your constraints.
Make the UI context-aware visibility/enablement (Least preffered) : Use a When or Access-When that checks the current app from the requestor/thread eg: compare to APP-A’s application rule name/ID to show the Edit access only in APP-A.
Based on your requirements to allow switched users to view only/no view, you may used combination of the approaches above.
This would mean toggles defined in APP A should be available in APP B.
Toggles defined in APP B, are visible in APP A toggle overview, but should not be available.
This holds true during a fresh log in to APP A or APP B.
This issue occurs when a single operator holds AG’s corresponding to both applications. Operator logs in to APP A (dev studio). Switches to APP B, navigates to toggles overview. APP A toggles are visible and available to change.