20032: Fix unnecessary race in test.
[arvados.git] / apps / workbench / app / controllers / links_controller.rb
index 35a5dbc2e880295c57f7cde19af6e4950abffb8d..b79fad4a6c07e16ad2131656b62717b230f1718b 100644 (file)
@@ -1,3 +1,13 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 class LinksController < ApplicationController
-  before_filter :ensure_current_user_is_admin
+  def show
+    if @object.link_class == 'name' and
+        Collection == ArvadosBase::resource_class_for_uuid(@object.head_uuid)
+      return redirect_to collection_path(@object.uuid)
+    end
+    super
+  end
 end