Use the Security APIs
- Last UpdatedJun 25, 2024
- 1 minute read
In the following example, we create a Work Order form and we hide controls based on the Security Group of the user viewing the form.
-
Create a Work Order form as shown in the following image:

-
Modify the properties of the Edit tab of the Tabs control as follows:
-
In the Scripts tab, set the script for the Visible property as follows:
var securityGroup = SFU.getUserSecurityGroup();
if(securityGroup === "WorkOrderAdmin")
{
return true;
}
return false;
-
-
Publish the form.
The Edit tab is not visible to a user who does not belong to the WorkOrderAdmin security group.
Note: You can use SFU.getUserRoles() and SFU.getValueForRightCode() security API's in the same way as described in this example.