Merge branch '11917-dont-clear-cache'
[arvados.git] / apps / workbench / app / controllers / users_controller.rb
index 4a88983f5045ee15e8ec6433cda93ac3b27b2edd..2e3ced69a534485ca5d18df22b19ac53abeea793 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 class UsersController < ApplicationController
   skip_around_filter :require_thread_api_token, only: :welcome
   skip_before_filter :check_user_agreements, only: [:welcome, :inactive]
@@ -102,6 +106,7 @@ class UsersController < ApplicationController
         filter([[:object_uuid, '=', u.uuid],
                 [:event_type, '=', 'user-storage-report']]).
         order(:created_at => :desc).
+        with_count('none').
         limit(1)
       storage_log.each do |log_entry|
         # We expect this block to only execute once since we specified limit(1)
@@ -255,32 +260,6 @@ class UsersController < ApplicationController
     end
   end
 
-  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: @object.uuid)
-
-    @my_repositories = (Repository.where(uuid: repo_links.collect(&:head_uuid)) |
-                        owned_repositories).
-                       uniq { |repo| repo.uuid }
-
-
-    @repo_writable = {}
-    repo_links.each do |link|
-      if link.name.in? ['can_write', 'can_manage']
-        @repo_writable[link.head_uuid] = link.name
-      end
-    end
-
-    owned_repositories.each do |repo|
-      @repo_writable[repo.uuid] = 'can_manage'
-    end
-  end
-
   def virtual_machines
     @my_vm_logins = {}
     Link.where(tail_uuid: @object.uuid,
@@ -299,12 +278,6 @@ class UsersController < ApplicationController
     @my_ssh_keys = AuthorizedKey.where(key_type: 'SSH', owner_uuid: @object.uuid)
   end
 
-  def manage_account
-    repositories
-    virtual_machines
-    ssh_keys
-  end
-
   def add_ssh_key_popup
     respond_to do |format|
       format.html