We want to restrict admins in PROD to manually run few data pages that invokes some external APIs. Is there a way to restrict manual execution of a data page based on the environment.
Can you try to add privileges on the security tab of the data page?
Add Privileges is a good option, but ensure the end user access roles have the necessary privileges and that the admins’ access groups are different.
@RameshSangili@SohamM95 Any other possible option than using privileges. We are already investigating on using Privilege.
@Vamsi.Thatavarthi To avoid external APIs being run , one workaround run can be by using alternate source of dummy data transform conditionally based on parameter, Pass the parameter value from one time utilities & conditionalize the connector source of data page to run only if that parameter has value, In otherwise dummy data transform can be referred.
Here is how we achieved it.
-
Create a when rule (Rule-Declare-Pages) with all the criteria for restriction. In my case it was Production level & Rule name (.pyRuleName).
-
Specialize when rule pyRuleFormToolbarShowHarnessRun (Rule-Declare-Pages) to app layer and plug in the when rule containing restriction criteria. Make sure pyRuleFormToolbarShowHarnessRun returns false when restriction criteria is met.
-
Specialize section pyGetParamAndRun (Rule-Declare-Pages) and hide layouts containing Flush checkbox and Execute button based in the when rule created in step1. Layouts will be hidden when the When rule returns true. Also, you can add a notification that the manual run is resticted on the same section.
Attaching the screenshot of the outcome.
@RameshSangili Admins should be able to execute one-time utilities which invokes these data pages. Only manual run of these data pages should be restricted. Privilege will restrict both the cases.
