Merge branch 'master' into 6234-user-edit-self
[arvados.git] / services / api / app / controllers / arvados / v1 / virtual_machines_controller.rb
index 35e5e4257afa5745e1e5a36337a284da2a141ccd..519178b0bbcf319426dbca39d181be58ef800420 100644 (file)
@@ -24,11 +24,11 @@ class Arvados::V1::VirtualMachinesController < ApplicationController
       vm.login_permissions.each do |perm|
         user_uuid = perm.tail_uuid
         @users[user_uuid].andand.authorized_keys.andand.each do |ak|
-          username = perm.properties.andand['username']
-          if username
+          unless perm.properties['username'].blank?
             @response << {
-              username: username,
+              username: perm.properties['username'],
               hostname: vm.hostname,
+              groups: (perm.properties["groups"].to_a rescue []),
               public_key: ak.public_key,
               user_uuid: user_uuid,
               virtual_machine_uuid: vm.uuid,