X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4f552c0187f8c31d94ff74485c57ef7f9888597e..b046d1f162990361418a8e926aead5b307402a42:/apps/workbench/app/models/link.rb diff --git a/apps/workbench/app/models/link.rb b/apps/workbench/app/models/link.rb index 5e7b42a60b..b1bbcff126 100644 --- a/apps/workbench/app/models/link.rb +++ b/apps/workbench/app/models/link.rb @@ -4,4 +4,22 @@ class Link < ArvadosBase def self.by_tail(t, opts={}) where(opts.merge :tail_uuid => t.uuid) end + + 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