core/Members availability

LabKey Support Forum (Inactive)
core/Members availability martin  2015-04-07 03:42
Status: Closed
 
hi,

i am trying to display logged users their groups, using query to core/Members but it shows empty unless i give the users folder administrator permission.

this is unexpected, considering the fact, that Members should be available to any logged user (according to description in schema browser)

am i missing something?

thank you for answering my question
martin
 
 
Will Holtz responded:  2015-04-07 10:19
I was previously tripped up by some outdated information in the schema browser on core table permission, and this might be a similar issue. You can find my thread on this here: https://www.labkey.org/announcements/home/Developer/Forum/thread.view?entityId=0404f62a-9dd2-1032-89d0-e5ac46246420&_anchor=10368

-Will
 
martin responded:  2015-04-08 03:01
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
 
Jon (LabKey DevOps) responded:  2015-04-08 15:30
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
 
martin responded:  2015-04-08 23:02
that works:)
thank you
 
jeckels responded:  2015-04-09 07:52
I've updated the description of the core.Users and core.Members queries to reflect the changes in permissions required to see email addresses, so in 15.2 and beyond the expected behavior will be clearer.

Thanks,
Josh