Combined contents of "Setting up SSH" into "Virtual Machines" panel. Added
[arvados.git] / apps / workbench / app / controllers / users_controller.rb
index d578631e9c4ba0a9339235a89d21d924279addea..3bcb956b97893b62c71e53b01ca7089859f4a8be 100644 (file)
@@ -213,9 +213,11 @@ class UsersController < ApplicationController
   def manage_account
     # repositories current user can read / write
     repo_links = []
-    Link.where(tail_uuid: current_user.uuid,
-               link_class: 'permission',
-               name: ['can_write', 'can_read']).
+    Link.filter([['head_uuid', 'is_a', 'arvados#repository'],
+                 ['tail_uuid', '=', current_user.uuid],
+                 ['link_class', '=', 'permission'],
+                 ['name', 'in', ['can_write', 'can_read']],
+               ]).
           each do |perm_link|
             repo_links << perm_link[:head_uuid]
           end
@@ -261,6 +263,11 @@ class UsersController < ApplicationController
         key_params['public_key'] = params['public_key']
       end
 
+      if !key_params['name'] && params['public_key'].andand.size>0
+        split_key = key_params['public_key'].split
+        key_params['name'] = split_key[-1] if (split_key.size == 3)
+      end
+
       new_key = AuthorizedKey.create! key_params
       if new_key
         format.js