My question is simple, I'm trying to build a system to manage Users and Groups for each User, so in order to add a user to a group (or remove the user from a group) I need to know which groups this user belongs to in both sides. Otherwise I have to go through each group, check if the user exist there and perform the corresponding operation.
So I'd like to do:
external_groups = box_client.get_groups_for_user(@user)
internal_groups = @user.get_groups
#Add User to group
(internal_groups - external_groups).each{ |group_id|
add_user_to_group(group_id)
}
#Remove User from group
(external_groups - internal_groups).each{ |group_id|
remove_user_from_group(group_id)
}
Is there any API action that allows me to list which Groups a User belongs to in Box?