10-15-2007 06:19 AM
10-15-2007 07:11 AM
10-15-2007 07:32 AM
Hi,
The type information I believe is not available from the User information. The only way would be to use the privileges.
Regards
Ray Farmer
10-15-2007 11:49 AM
10-16-2007 07:11 AM
01-20-2012 06:09 AM - edited 01-20-2012 06:10 AM
Hello, I had the same problem. Here is a smaller version to find the Group of the current User.
The VI get the members of a Group and match it with the Username.
Note :
If the User belongs to multiple Groups the the VI returns only the 1st Groupname
If the User belongs to no Group then the VI returns "unknown Group"
The VI is written with LabVIEW 2010 and TestStand 4.2.1
12-30-2015 12:59 PM - edited 12-30-2015 01:17 PM
This should help some people. Took two full days to figure out how to access the correct members...
TestStand Users and Groups C# API
http://www.broxsoft.com/portfolio/helpers/TestStandUsersGroupsAPI.htm
05-30-2016 04:56 AM
Hi
Anyone know how to get the Groups names using Labwindows/CVI?
Created this code but for some reason im not getting the GroupName from this function
TS_PropertyGetValStringByOffset (groupList, &errorInfo, i, 0, GroupName);
//Example to Retreive Groups Names and filter via group names
TS_EngineGetUsersFile (engine, NULL,&UserFile); TS_UsersFileGetUserGroupList (UserFile, &errorInfo, &groupList); TS_PropertyGetNumElements (groupList, &errorInfo, &numGroups); for(int i=0; i<numGroups; i++) { TS_PropertyGetPropertyObjectByOffset (groupList, &errorInfo, i, 0, &group); TS_PropertyGetValStringByOffset (groupList, &errorInfo, i, 0, GroupName); if(!stricmp(GroupName,"Operator")) { TS_UserGetMembers ((TSObj_User)group, &errorInfo, &members); } }
01-20-2020 07:08 AM - edited 01-20-2020 07:10 AM
Here is a simple method that checks whether the user has a privilege that is owned by a group but not by any lower (less potent) group (this is C#):
if (user.HasPrivilege("Configure.GrantAll")) // only Administrators have this
group = "Administrator";
else if (user.HasPrivilege("Develop.GrantAll")) // Technicians and Operators don't have this
group = "Developer";
else if (user.HasPrivilege("Operate.GrantAll")) // Operators don't have this - surprisingly!
group = "Technician";
else
group = "Operator";
. 'user' is the User object obtained, for example, from Engine().UsersFile.UserList.GetPropertyObject(username, 0).
If a user is in multiple groups it returns the highest group.