To download NI software, including the products shown below, visit ni.com/downloads.
This example shows how to check for specific permissions before running the rest of a sequence. This can be useful to prevent certain users from unintentionally running diagnostic or debugging code.
You may want to restrict which users have permission to run certain sequence files, for example, you may want to prevent an operator user from running a calibration routine. To accomplish this, you can use the TestStand API to check whether the current user has a specific permission:
RunState.Engine.CurrentUser.HasPrivilege("Debug")
In this example, if this method returns false, the sequence file terminates and reports to the user that the sequence requires specific permissions to execute.
Require Privileges To Execute - TS2012.seq
TestStand 2012 or Compatible
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.