Also, dashboard displays the 'Run a pipeline' selector for active users. Upated anonymous user test to verify dashboard access.
<div class="selection-action-container" style="padding-left: <%=padding_left%>">
<% if !defined? no_checkboxes or !no_checkboxes %>
<div class="row">
+ <% if current_user.is_active %>
<div class="pull-left">
<div class="btn-group btn-group-sm">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection... <span class="caret"></span></button>
<div class="pull-right">
<input class="form-control filterable-control" data-filterable-target="ul#collection_files" id="file_regex" name="file_regex" placeholder="filename regex" type="text"/>
</div>
+ <% end %>
</div>
<p/>
<% end %>
<div class="col-md-6">
<div class="panel panel-default" style="min-height: 10.5em">
<div class="panel-heading"><span class="panel-title">Active pipelines</span>
+ <% if current_user.is_active %>
<span class="pull-right">
- <%= link_to(
+ <%= link_to(
choose_pipeline_templates_path(
title: 'Choose a pipeline to run:',
action_name: 'Next: choose inputs <i class="fa fa-fw fa-arrow-circle-right"></i>',
action_method: 'post',
action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => current_user.uuid, 'success' => 'redirect-to-created-object'}.to_json),
{ class: "btn btn-primary btn-xs", remote: true }) do %>
- <i class="fa fa-fw fa-gear"></i> Run a pipeline...
- <% end %>
- </span>
+ <i class="fa fa-fw fa-gear"></i> Run a pipeline...
+ <% end %>
+ </span>
+ <% end %>
</div>
<% _running_pipelines = running_pipelines %>
visit "/projects/#{api_fixture('groups')['anonymously_accessible_project']['uuid']}/?public_data=true"
end
+ test "verify dashboard when anonymous user accesses shared project" do
+ visit_publicly_accessible_project
+ assert_selector 'a', text: 'You are viewing public data'
+
+ # go to dashboard
+ click_link 'You are viewing public data'
+ assert_no_selector 'a', text: 'Run a pipeline'
+ assert_selector 'a', text: 'All pipelines'
+ assert_selector 'a', text: 'All jobs'
+ assert_selector 'a', text: 'All collections'
+ end
+
test "anonymous user accesses data collections tab in shared project" do
visit_publicly_accessible_project
# in collection page
assert_no_selector 'input', text: 'Create sharing link'
assert_no_selector 'a', text: 'Upload'
+ assert_no_selector 'button', 'Selection'
within ('#collection_files') do
assert_text 'GNU_General_Public_License,_version_3.pdf'