so it's an outdated information?
then could you point me to a way how to get groups of a selected user?
in LABKEY.Security I see only getGroupsForCurrentUser...
When querying core/Users, even non-admin user can see all users and their groups.
however when trying to Select Groups From Users Where userId = XY, it returns only userId (XY) of a user, not IDs of groups, even though the names of groups are displayed in the table.
if non-admin user has no access to group ids through Users, Members nor Principals then there is no way to get groups of a different user.
is this a security thing?
but then it seems like there is something i'm missing - non-admin users can see groups of other users, but have no programmatic access to them?
is this true?:)
thank you very much
martin |
Hi Martin,
If the goal is to get groups of a selected user and obtain the userIds of the groups, you should be able to still do this from core/Users. The field that will give you the group ID numbers is called 'Groups/UserId'.
If you go into your Users table and customize the view, then click on the + next to Groups, you should see a bunch of sub-options under it that it's pulling from the Groups table via a lookup. If you select UserId and then view the grid, you'll see your group ID numbers and if you decide to export the view into JavaScript, you'll see the column called 'Groups/UserId'.
--------------
LABKEY.Query.selectRows({
requiredVersion: 9.1,
schemaName: 'core',
queryName: 'Users',
columns: 'UserId,DisplayName,Email,Active,LastLogin,Created,FirstName,LastName,Phone,Mobile,Groups,Groups/UserId',
filterArray: null,
success: onSuccess,
failure: onError
});
--------------
This will appear for anyone regardless of permissions. Will that work for you?
Regards,
Jon |