11060: sort order and delete prompt updated
[arvados.git] / apps / workbench / app / controllers / users_controller.rb
index d3acf58963c2af5b05ff6a8520fdc1827cf64ac6..350f297af3bbcea1b3f9797b273ab15c7cf072c0 100644 (file)
@@ -258,16 +258,9 @@ class UsersController < ApplicationController
 
   def repositories
     # all repositories accessible by current user
-    all_repositories = Hash[Repository.where(authorized_user_uuid: current_user.uuid).collect {|repo| [repo.uuid, repo]}]
+    all_repositories = Hash[Repository.all.order('name asc').collect {|repo| [repo.uuid, repo]}]
 
-    # repositories shared with the user
-    repo_links = Link.
-      filter([['head_uuid', 'is_a', 'arvados#repository'],
-              ['tail_uuid', '=', current_user.uuid],
-              ['link_class', '=', 'permission'],
-             ])
-
-    @my_repositories = [] # we want them ordered as owned, manageable, and the rest
+    @my_repositories = [] # we want them ordered as owned and the rest
     @repo_writable = {}
 
     # owned repos
@@ -278,15 +271,6 @@ class UsersController < ApplicationController
       end
     end
 
-    # shared and either writable or manageable
-    handled = @my_repositories.map(&:uuid)
-    repo_links.each do |link|
-      if link.name.in? ['can_write', 'can_manage']
-        @repo_writable[link.head_uuid] = link.name
-        @my_repositories << all_repositories[link.head_uuid] if !link.head_uuid.in?(handled)
-      end
-    end
-
     # rest of the repos
     handled = @my_repositories.map(&:uuid)
     all_repositories.each do |_, repo|