+ def sharing_popup
+ @search_sharing = search_scopes.select { |s| s.scopes != ['all'] }
+ respond_to do |format|
+ format.html
+ format.js
+ end
+ end
+
+ helper_method :download_link
+
+ def download_link
+ collections_url + "/download/#{@object.uuid}/#{@search_sharing.first.api_token}"
+ end
+
+ def share
+ a = ApiClientAuthorization.create(scopes: sharing_scopes)
+ @search_sharing = search_scopes.select { |s| s.scopes != ['all'] }
+ render 'sharing_popup'
+ end
+
+ def unshare
+ @search_sharing = search_scopes.select { |s| s.scopes != ['all'] }
+ @search_sharing.each do |s|
+ s.destroy
+ end
+ @search_sharing = search_scopes.select { |s| s.scopes != ['all'] }
+ render 'sharing_popup'
+ end
+