NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

User Privilege question

Hi,

I would like to give a user the privilege of 'Run Selected Steps Using Single Pass' but without the privilege of 'Run Selected Step'.

Reasoning: The first creates a report and log into the database where the latter does not.

I checked the privileges >> Debug >> RunSelectedTests and ...>> SinglePass but it opens both privileges.

Can it be done?

Thanks
Rafi
0 Kudos
Message 1 of 2
(2,739 Views)
Hey Rafi,

Here's an idea that may work for you:

Add an engine callback that gets called before every interactive execution. (You can force it to be called before every interactive execution on the computer.) In this callback check if the top sequence file is a process model and if the user has some priviledge. If the top process model is not a process model and the user doesn't have some priviledge then display a message saying the user must use Single Pass and terminate the exeuction.

Here's how to implement this.

1. Open up the StationCallbacks.seq file. Located in the C:\Program Files\National Instruments\TestStand 3.1\Components\User\Callbacks\Station directory. (This directory may vary depending on your version of TestStand and whether you used the default installation directory.)

2. Add the StationPreInteractive callback by going Edit >> Sequence File Callbacks

3. In the callback add two steps. The first a message popup telling the user they need to use a process model. The second an activeX action step. Select RunState.Execution as the object reference and Execution as the object class. Call the TerminateInteractiveExecution method.

4. Finally add a precondition to both steps:

RunState.Caller.RunState.Root.RunState.IsProcessModel == False

5. This doesn't allow anyone to run selected steps without a process model. If you want to allow some users then you can add another precondition (make sure to and them).

!CurrentUserHasPrivilege("Privilege")

Privilege is whatever user privilege the user must have in order to be able to run without a process model. You can pick whatever privilege you think appropriate.

I hope this helps!!!

Regards,

Sarah Miracle
National Instruments
0 Kudos
Message 2 of 2
(2,715 Views)