Bug #4971
closedapi/usergroups/:id does not return correct usergroup_members
Description
The api endpoint is not returning the correct membership ids. It appears to be returning incremented numbers. For an example of this, create a usergroup and assign random users to it. Do a curl request and observe how the usergroup_members probably don't match the ids of the actual users:
"usergroup_members":[16,17,18]
Take note of the highest value in usergroup_members and then add another member via the UI. Do a followup curl request and the list of ids should be an additional, plus one of the highest previous value.
"usergroup_members":[16,17,18,19]
Actual theoretical ids would be 3, 7, 12, 22.
Updated by Dominic Cleal about 11 years ago
- Status changed from New to Feedback
I believe this is actually referring to an intermediate linking object ("UsergroupMember") between user groups and users, which definitely isn't very helpful (as you can't access these as first class entities via the API).
This appears to have been addressed in Foreman 1.5, as the GET /api/v2/usergroups/Foo call will now return "users" as a node with an array of the users (their IDs and logins) within the user group.
Updated by Daniel Khodaparast about 11 years ago
It'd be great if that could be addressed as well in 1.4, since currently, like you said that data isn't helpful at all.
Updated by Dominic Cleal about 11 years ago
- Status changed from Feedback to Resolved
Sorry, 1.4 has already been released and is only getting important bug fixes. Foreman 1.5 is due out in about a month, and nightlies are available for testing.
Updated by Daniel Khodaparast about 11 years ago
Oh wow, didn't know that 1.5 was coming down the pipeline so fast. Well that changes things. Thanks Dominic!