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
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|