X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/16f704326f44fd1e5e5e60b936c9b5895d6a6ff8..c7cf228372bee18d84b14fc4089a758bc157fe76:/apps/workbench/app/views/application/_show_sharing.html.erb diff --git a/apps/workbench/app/views/application/_show_sharing.html.erb b/apps/workbench/app/views/application/_show_sharing.html.erb deleted file mode 100644 index 8403ee0b4f..0000000000 --- a/apps/workbench/app/views/application/_show_sharing.html.erb +++ /dev/null @@ -1,136 +0,0 @@ -<%# Copyright (C) The Arvados Authors. All rights reserved. - -SPDX-License-Identifier: AGPL-3.0 %> - -<% - uuid_map = {} - if @share_links - [User, Group].each do |type| - type - .filter([['uuid','in',@share_links.collect(&:tail_uuid)]]) - .each do |o| - uuid_map[o.uuid] = o - end - end - end - perm_name_desc_map = {} - perm_desc_name_map = {} - perms_json = [] - ['Read', 'Write', 'Manage'].each do |link_desc| - link_name = "can_#{link_desc.downcase}" - perm_name_desc_map[link_name] = link_desc - perm_desc_name_map[link_desc] = link_name - perms_json << {value: link_name, text: link_desc} - end - perms_json = perms_json.to_json - choose_filters = { - "groups" => [["group_class", "=", "role"]], - } - if not Rails.configuration.anonymous_user_token - # It would be ideal to filter out the anonymous group by UUID, - # but that's not readily doable. Workbench can't generate the - # UUID for a != filter, because it can't introspect the API - # server's UUID prefix. And we can't say "uuid not like - # %-anonymouspublic", because the API server doesn't support a - # "not like" filter. - choose_filters["groups"] << ["name", "!=", "Anonymous users"] - end - choose_filters.default = [] - owner_icon = fa_icon_class_for_uuid(@object.owner_uuid) - if owner_icon == "fa-users" - owner_icon = "fa-folder" - owner_type = "parent project" - else - owner_type = "owning user" - end - - sharing_path = url_for(:controller => params['controller'], :action => 'share_with') -%> - -
- <% ["users", "groups"].each do |share_class| %> - - <%= link_to(send("choose_#{share_class}_path", - title: "Share with #{share_class}", - message: "Only #{share_class} you are allowed to access are shown. Please contact your administrator if you need to be added to a specific group.", - by_project: false, - preview_pane: false, - multiple: true, - filters: choose_filters[share_class].to_json, - action_method: 'post', - action_href: sharing_path, - action_name: 'Add', - action_data: {selection_param: 'uuids[]', success: 'tab-refresh'}.to_json), - class: "btn btn-primary btn-sm", remote: true) do %> - Share with <%= share_class %>… - <% end %> - - <% end %> -
- -

Permissions for this <%=@object.class_for_display.downcase%> are inherited from the <%= owner_type %> - - <%= link_to_if_arvados_object @object.owner_uuid, friendly_name: true %>. -

- -<% if @object.is_a? Repository %> -

- Please note that changes to git repository sharing may take up to two minutes to take effect. -

-<% end %> - - - - - - - - - <% @share_links.andand.each do |link| - shared_with = uuid_map[link.tail_uuid] - if shared_with.nil? - link_name = link.tail_uuid - elsif shared_with.respond_to?(:full_name) - link_name = shared_with.full_name - else - link_name = shared_with.name - end - if shared_with && shared_with.respond_to?(:email) - email = shared_with.email - end - %> - - - - - - - <% end %> -
User/Group NameEmail Address<%=@object.class_for_display%> Access
- - <%= link_to_if_arvados_object(link.tail_uuid, link_text: link_name) %> - - <%= email %> - <%= link_to perm_name_desc_map[link.name], '#', { - "data-emptytext" => "Read", - "data-placement" => "bottom", - "data-type" => "select", - "data-url" => url_for(action: "update", id: link.uuid, controller: "links", merge: true), - "data-title" => "Set #{link_name}'s access level", - "data-name" => "[name]", - "data-pk" => {id: link.tail_uuid, key: "link"}.to_json, - "data-value" => link.name, - "data-clear" => false, - "data-source" => perms_json, - "data-tpl" => "", - "class" => "editable form-control", - } %> - - <%= link_to( - {action: 'destroy', id: link.uuid, controller: "links"}, - {title: 'Revoke', class: 'btn btn-default btn-nodecorate', method: :delete, - data: {confirm: "Revoke #{link_name}'s access to this #{@object.class_for_display.downcase}?", - remote: true}}) do %> - - <% end %> -