NI TestStand Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Elaine_R.

Add new API for Engine.GetUserIndex("loginName") or Engine.UpdateUser("loginName", User obj)

Status: New

It is really easy to get a user in system by name via the current API methods

 

User = Engine.GetUser("loginName")

 

but if you want to (A) delete that user, or (B) update values related to that user (password/fullname/loginname) there feels like an unnecessary number of hoops that must be vaulted through related to digging through UserFile->userList->AsPropertyObject-> Get/SetPropertyObjectByOffset()

 

in both cases, I'm obliged to loop through the userList to find the element I want, and then fetch/set/delete it.

 

I would love if there was some shortcut in the API to take on this chore for me in a more efficient manner.  Something as simple as:

index = Engine.GetUserIndex("loginName")

 

would match behavior that already exists with Sequences and Steps so that I can efficiently know what array element I want to interact with based on the current name.

 

or if we wanted to get fancy we could have an:

 

success = Engine.UpdateUser("loginName", UpdatedUser obj) 

 

function that would go all the way and actually take a replacement user object and do the array overwrite & save the file for me... but I'd be content to do that myself if there was just an easier way to get the information I wanted in/out of the userlist having to maintain my own search list for users in memory feels tedious.  We already have GetStepIndex() and GetSequenceIndex(), so why not one for users too?

 

--Elaine R.