Author: Ian Britz
In Dashboard Apps, it's often necessary to restrict certain workflow actions and rules to only be allowed at a specific phase in the workflow. Sometimes it's necessary to restrict particular users from using certain rules or interacting with certain Forms or menus. For both these situations and more, you can make use of the Disable Dashboard Component feature.
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. To configure this, first select the Disable button in the menu bar of the Dashboard Designer.
In the DEFINITION tab we can write SQL Queries to determine which components to disable. The result of this query should contain the list of components we want to disable. For example, to disable a component called Rule1 we could write:
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'
The COMPONENT tab contains a list of the names of all the components on the current page, for reference in the DEFINITION tab.
You can manage and rename components in the Selection pane on the left-hand panel in the Dashboard Designer.
The EXAMPLE tab lists the Default Parameters you can use, as well as some sample SQL queries.
After selecting OK and saving the Dashboard, we can impersonate John Smith to confirm that the Rule Component is now disabled.