1 class UsersController < ApplicationController
2 skip_before_filter :find_object_by_uuid, :only => :welcome
3 skip_around_filter :thread_with_mandatory_api_token, :only => :welcome
4 before_filter :ensure_current_user_is_admin, only: :sudo
8 params[:action] = 'home'
14 if current_user.andand.is_admin
22 resp = $arvados_api_client.api(ApiClientAuthorization, '', {
23 api_client_authorization: {
24 owner_uuid: @object.uuid
27 redirect_to root_url(api_token: resp[:api_token])
31 @showallalerts = false
32 @my_ssh_keys = AuthorizedKey.where(authorized_user_uuid: current_user.uuid)
33 # @my_vm_perms = Link.where(tail_uuid: current_user.uuid, head_kind: 'arvados#virtual_machine', link_class: 'permission', name: 'can_login')
34 # @my_repo_perms = Link.where(tail_uuid: current_user.uuid, head_kind: 'arvados#repository', link_class: 'permission', name: 'can_write')
40 order('created_at desc').
41 where(created_by: current_user.uuid)
43 @my_collections = Collection.
45 order('created_at desc').
46 where(created_by: current_user.uuid)
48 Link.limit(1000).where(head_uuid: @my_collections.collect(&:uuid),
49 link_class: 'tag').each do |link|
50 (@my_tag_links[link.head_uuid] ||= []) << link
53 @my_pipelines = PipelineInstance.
55 order('created_at desc').
56 where(created_by: current_user.uuid)
59 # A Tutorial is a Link which has link_class "resources" and name
60 # "wants", and is owned by the Tutorials Group (i.e., named
61 # "Arvados Tutorials" and owned by the system user).
62 @tutorial_group = Group.where(owner_uuid: User.system.uuid,
63 name: 'Arvados Tutorials').first
65 @tutorial_links = Link.where(tail_uuid: @tutorial_group.uuid,
66 link_class: 'resources',
71 @tutorial_complete = {
72 'Run a job' => @my_last_job
75 f.js { render template: 'users/home.js' }
76 f.html { render template: 'users/home' }