X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0e57453d2b637a3d105d4e3d67031f3915f9d302..b04638275cff9b393e1bc04136d44f361b999cf8:/apps/workbench/app/controllers/users_controller.rb diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb index 4cf1fffc09..d2fcbbb94c 100644 --- a/apps/workbench/app/controllers/users_controller.rb +++ b/apps/workbench/app/controllers/users_controller.rb @@ -255,15 +255,14 @@ class UsersController < ApplicationController end end - def manage_account - # repositories current user can read / write + def repositories repo_links = Link. filter([['head_uuid', 'is_a', 'arvados#repository'], ['tail_uuid', '=', current_user.uuid], ['link_class', '=', 'permission'], ]) - owned_repositories = Repository.where(owner_uuid: current_user.uuid) + owned_repositories = Repository.where(owner_uuid: @object.uuid) @my_repositories = (Repository.where(uuid: repo_links.collect(&:head_uuid)) | owned_repositories). @@ -280,10 +279,11 @@ class UsersController < ApplicationController owned_repositories.each do |repo| @repo_writable[repo.uuid] = 'can_manage' end + end - # virtual machines the current user can login into + def virtual_machines @my_vm_logins = {} - Link.where(tail_uuid: current_user.uuid, + Link.where(tail_uuid: @object.uuid, link_class: 'permission', name: 'can_login'). each do |perm_link| @@ -293,13 +293,10 @@ class UsersController < ApplicationController end end @my_virtual_machines = VirtualMachine.where(uuid: @my_vm_logins.keys) + end - # current user's ssh keys - @my_ssh_keys = AuthorizedKey.where(key_type: 'SSH', owner_uuid: current_user.uuid) - - respond_to do |f| - f.html { render template: 'users/manage_account' } - end + def ssh_keys + @my_ssh_keys = AuthorizedKey.where(key_type: 'SSH', owner_uuid: @object.uuid) end def add_ssh_key_popup