Merge branch '8784-dir-listings'
[arvados.git] / apps / workbench / app / models / link.rb
index 868082b3ed9980652c24a9bc9eae451c620f0dd5..920b4bdcc561f542fe465369333a6c62b89098f4 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 class Link < ArvadosBase
   attr_accessor :head
   attr_accessor :tail
@@ -8,4 +12,18 @@ class Link < ArvadosBase
   def default_name
     self.class.resource_class_for_uuid(head_uuid).default_name rescue super
   end
+
+  def self.permissions_for(thing)
+    if thing.respond_to? :uuid
+      uuid = thing.uuid
+    else
+      uuid = thing
+    end
+    result = arvados_api_client.api("permissions", "/#{uuid}")
+    arvados_api_client.unpack_api_response(result)
+  end
+
+  def self.creatable?
+    false
+  end
 end