Skip to main content

How to customize Admin-only permissions

How to restrict usage of controls on screen via the Admin permissions of the signed-in user.

When customizing an app, you may want to allow functionality to only those users with admin permissions.

There are two things you need to know in order to customize this:

  • If the permission is to be applied to a control on the screen, the event to trigger this check should be one of the screen events.

  • The admin user permission can be retrieved using the value from session called User - Has Admin Permissions.


Example: Disable a field on the Estimates screen

In the below example, we will customize the estimate screen in the Builder to enable or disable the Skip QuickBooks sync for now toggle depending on whether or not the user logged in has admin permissions.

📌 Note: This example will assume the basics of customization are known.

  1. On the Estimate screen, click Customize and open the screen in the Builder.

  2. The default screen is read-only, so click Create copy.

  3. We should create permission checks for showing, hiding, enabling or disabling fields in its own Screen function. Click a blank part of the canvas to show the Screen properties, scroll down, and add a function.

  4. Call the new function Sync toggle permissions and then click + Add.

  5. To this new function, add an If...then action (a conditional statement).

  6. Set this conditional statement up to check if User - Has Admin Permissions (a value from session) is true.

  7. For the If true part of the statement, add in an Enable/Disable Controls action, and enable the checkbox IsWaitingForSyncApproval.

  8. For the Else part of the conditional statement, add in another Enable/Disable Controls action and this time disable the CheckBox IsWaitingForSyncApproval.

  9. Close the action list.

  10. Now put this new screen function in the the screen's Focus event, which runs every time the screen opens. Click a blank part of the canvas to show the Screen properties, and select Focus under Events.

  11. Scroll to the bottom of the action list, and add a Call Routine action.

  12. For this routine, select the new screen function created.

  13. Close the action list.

Now, when you test this screen, you will find those without the Admin permissions will not be able to change this toggle.

Did this answer your question?