How to customize Admin-only permissions

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

Updated over a week ago

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 to enable or disabled the wait for sync approval checkbox depending on whether or not the user logged in has admin permissions.

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

  1. Customize the Estimate screen and create a copy of it.

  2. All permission checks for showing or hiding fields is done in the Screen's Load event, so open that up.

  3. At the bottom, add a conditional statement.

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

  5. For the If true part of the statement, add in an Enable / Disable Controls action.

  6. For the Enable / Disable Controls action, enable the field IsWaitingForSyncApproval.

  7. For the Else part of the conditional statement, add in another Enable / Disable Controls action.

  8. For this Enable / Disable Controls action, disable the field IsWaitingForSyncApproval.

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

Did this answer your question?