[
['active', true],
- ['job_reader', false],
+ ['job_reader2', false],
].each do |user, readable|
test "view job with components as #{user} user" do
job = api_fixture('jobs')['running_job_with_components']
assert page.has_text? job['script_version']
assert page.has_no_text? 'script_parameters'
+ # The job_reader2 is allowed to read job, component2, and component2_child1,
+ # and component2_child2 only as a component of the pipeline component2
if readable
assert page.has_link? 'component1'
assert page.has_link? 'component2'
else
- # children are not readable by user
assert page.has_no_link? 'component1'
- assert page.has_no_link? 'component2'
- return
+ assert page.has_link? 'component2'
end
- click_link('component1')
- within('#collapse1') do
- assert(has_text? component1['uuid'])
- assert(has_text? component1['script_version'])
- assert(has_text? 'script_parameters')
+ if readable
+ click_link('component1')
+ within('#collapse1') do
+ assert(has_text? component1['uuid'])
+ assert(has_text? component1['script_version'])
+ assert(has_text? 'script_parameters')
+ end
+ click_link('component1')
end
- click_link('component1')
click_link('component2')
- within('#collapse2') do
+ within('.panel-collapse') do
assert(has_text? component2['uuid'])
assert(has_text? component2['script_version'])
assert(has_no_text? 'script_parameters')
assert(has_link? 'running')
click_link('previous')
- within('#collapse3') do
+ within('.panel-collapse') do
assert(has_text? component2_child1['uuid'])
assert(has_text? component2_child1['script_version'])
end
click_link('previous')
click_link('running')
- within('#collapse4') do
+ within('.panel-collapse') do
assert(has_text? component2_child2['uuid'])
- assert(has_text? component2_child2['script_version'])
+ if readable
+ assert(has_text? component2_child2['script_version'])
+ else
+ assert(has_no_text? component2_child2['script_version'])
+ end
end
end
end
api_token: e99512cdc0f3415c2428b9758f33bdfb07bc3561b00e86e7e6
expires_at: 2038-01-01 00:00:00
+job_reader2:
+ uuid: zzzzz-gj3su-jobreader2autht
+ api_client: untrusted
+ user: job_reader2
+ api_token: e99512cdc0f3415c2428b9758f33bdfb07bc3561b00e86e7e6
+ api_token: jobreader2415c2428b9758f33bdfb07bc3561b0jobreader2
+ expires_at: 2038-01-01 00:00:00
+
active_no_prefs:
uuid: zzzzz-gj3su-307z32aux8dg2s1
api_client: untrusted
api_client: untrusted
user: system_user
api_token: kwi8oowusvbutahacwk2geulqewy5oaqmpalczfna4b6bb0hfw
- expires_at: 2038-01-01 00:00:00
\ No newline at end of file
+ expires_at: 2038-01-01 00:00:00
tail_uuid: zzzzz-tpzed-905b42d1dd4a354
head_uuid: zzzzz-8i9sb-cjs4pklxxjykqqq
-job_reader_can_read_job_with_components:
- # Permission link giving job_reader permission
+job_reader2_can_read_job_with_components:
+ # Permission link giving job_reader2 permission
# to read running_job_with_components
uuid: zzzzz-o0j2j-jobcomps4jobrdr
owner_uuid: zzzzz-tpzed-000000000000000
updated_at: 2014-06-13 20:42:26 -0800
link_class: permission
name: can_read
- tail_uuid: zzzzz-tpzed-905b42d1dd4a354
+ tail_uuid: zzzzz-tpzed-readjobwithcomp
head_uuid: zzzzz-8i9sb-with2components
-job_reader_can_read_foo_repo:
- # Permission link giving job_reader permission
+job_reader2_can_read_pipeline_from_job_with_components:
+ # Permission link giving job_reader2 permission
+ # to read running_job_with_components
+ uuid: zzzzz-o0j2j-pi4comps4jobrdr
+ owner_uuid: zzzzz-tpzed-000000000000000
+ created_at: 2014-06-13 20:42:26 -0800
+ modified_by_client_uuid: zzzzz-tpzed-000000000000000
+ modified_by_user_uuid: zzzzz-tpzed-000000000000000
+ modified_at: 2014-06-13 20:42:26 -0800
+ updated_at: 2014-06-13 20:42:26 -0800
+ link_class: permission
+ name: can_read
+ tail_uuid: zzzzz-tpzed-readjobwithcomp
+ head_uuid: zzzzz-d1hrv-partdonepipelin
+
+job_reader2_can_read_first_job_from_pipeline_from_job_with_components:
+ # Permission link giving job_reader2 permission
+ # to read running_job_with_components
+ uuid: zzzzz-o0j2j-job4pi4j4jobrdr
+ owner_uuid: zzzzz-tpzed-000000000000000
+ created_at: 2014-06-13 20:42:26 -0800
+ modified_by_client_uuid: zzzzz-tpzed-000000000000000
+ modified_by_user_uuid: zzzzz-tpzed-000000000000000
+ modified_at: 2014-06-13 20:42:26 -0800
+ updated_at: 2014-06-13 20:42:26 -0800
+ link_class: permission
+ name: can_read
+ tail_uuid: zzzzz-tpzed-readjobwithcomp
+ head_uuid: zzzzz-8i9sb-cjs4pklxxjykqqq
+
+job_reader2_can_read_foo_repo:
+ # Permission link giving job_reader2 permission
# to read foo_repo
uuid: zzzzz-o0j2j-072ec05dc9487f8
owner_uuid: zzzzz-tpzed-000000000000000
updated_at: 2014-06-13 20:42:26 -0800
link_class: permission
name: can_read
- tail_uuid: zzzzz-tpzed-905b42d1dd4a354
+ tail_uuid: zzzzz-tpzed-readjobwithcomp
head_uuid: zzzzz-s0uqq-382brsig8rp3666
baz_collection_name_in_asubproject:
role: Computational biologist
getting_started_shown: 2015-03-26 12:34:56.789000000 Z
+job_reader2:
+ owner_uuid: zzzzz-tpzed-000000000000000
+ uuid: zzzzz-tpzed-readjobwithcomp
+ email: job_reader2@arvados.local
+ first_name: Job
+ last_name: Reader2
+ identity_url: https://job_reader2.openid.local
+ is_active: true
+ is_admin: false
+ username: jobreader2
+ prefs:
+ profile:
+ organization: example.com
+ role: Computational biologist
+ getting_started_shown: 2015-03-26 12:34:56.789000000 Z
+
active_no_prefs:
owner_uuid: zzzzz-tpzed-000000000000000
uuid: zzzzz-tpzed-a46c42d1td4aoj4