Introduction
In Dashboard Apps, it's often necessary to allow certain actions and Rules only at a specific phase in the workflow. Alternatively, admins might want to restrict particular users from using certain Rules or interacting with certain Forms or menus. For both these situations and more, use the Disable Dashboard Component feature.
Example
As an example, let's create a simple condition where a particular user, named John Smith, isn't allowed to interact with the Add Employee rule component.
1. In the Dashboard Editor, click Disable in the ribbon.
2. In the Definition tab, we can write SQL Queries to determine which components to disable.
Tip: Refer to the Example tab for default Parameters you can use, as well as some sample SQL queries.
For example, to disable a component called Rule1, we could write:
SELECT N'Rule1'
The query below will check if the UserID of the current user in the Dashboard matches the UserID belonging to John Smith. If so, we'll select the Rule Component we want to disable.
IF @UserID IN (
SELECT [UserID] FROM [dbo].[Users] WHERE [UserName] = N'DOMAIN\John Smith'
)
BEGIN
SELECT N'Rule1';
END;
Tip: The Component pane lists all the components on the current page, for your reference while writing definitions. You can manage and rename components in the Selection pane of the Dashboard Editor.
3. Select OK when finished.
To test the change, we impersonated John Smith. You can see Add Employee has been disabled.