NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

use own user dialog

Solved!
Go to solution

Hello,

 

i think this it only to get the user privileg not to set it. I have my user data in a database and i want to use this data (not the data from the user configuration file of TS).

 

First solution is to replace the original login/logout step with my own steps and replace the data in the configuration file with my data.

Second solution is to make TS to use my data from the database..... Any ideas how it is possible?

 

greetings schwede

0 Kudos
Message 11 of 12
(814 Views)

Schwede -

 

It's tough to completely understand what it is that you want so I'm going to provide a suggestion based on some assumptions I've made:

 

From your posts, my understanding is that you have a database. In this database, you store information such as User Name and Privileges. Rather than creating the identical User Objects in TestStand manually, you want to pull the User Name, Password, and Privileges directly from your database at the time of login, then allow that user to select their user name, enter their password, and be logged into TestStand with the appropriate Privileges.

 

If my understanding is correct, my recommendation is that you use your own code to read the necessary information from the database (user name, password, and privileges). Then, when the user selects their login name (I'm assuming you would display their user name in a combo box?), types their password, and presses okay, you can verify that the password the user provided is correct by comparing it to the password from the database. If the password is correct, you can create a new TestStand User using Engine.NewUser(). You could then set the login name for this new User object using User.LoginName. Finally, you could set the necessary privileges in the User.Privileges container and then assign this new user to Engine.CurrentUser.

 

Some things to be aware of: If you don't want the user to remain in the TestStand User List once they log out, you will have to delete the user from the User Manager. Also, you will have to come up with some standard way of naming the privileges in the database so that it is easy to assign them to the corresponding TestStand privileges (e.g. in some sort of loop).

 

Hope this helps.

Manooch H.
National Instruments
0 Kudos
Message 12 of 12
(795 Views)