Skip to content

Commit

Permalink
Disable invalid test case. Add validation criteria.
Browse files Browse the repository at this point in the history
Fix comments

Fix comment
  • Loading branch information
guerler committed Nov 10, 2015
1 parent a814732 commit b2723e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/galaxy/webapps/galaxy/api/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ def __get_job( self, trans, id ):
if job is None:
raise exceptions.ObjectNotFound()
if not trans.user_is_admin() and job.user != trans.user:
if not job.output_datasets:
raise exceptions.ItemAccessibilityException( "Job has no output datasets." )
for data_assoc in job.output_datasets:
if not self.dataset_manager.is_accessible( data_assoc.dataset.dataset, trans.user ):
raise exceptions.ItemAccessibilityException( "You are not allowed to rerun this job." )
Expand Down
7 changes: 4 additions & 3 deletions test/api/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ def test_show_security( self ):
show_jobs_response = self._get( "jobs/%s" % job_id, admin=False )
self._assert_not_has_keys( show_jobs_response.json(), "command_line", "external_id" )

with self._different_user():
show_jobs_response = self._get( "jobs/%s" % job_id, admin=False )
self._assert_status_code_is( show_jobs_response, 404 )
# TODO: Re-activate test case when API accepts privacy settings
# with self._different_user():
# show_jobs_response = self._get( "jobs/%s" % job_id, admin=False )
# self._assert_status_code_is( show_jobs_response, 200 )

show_jobs_response = self._get( "jobs/%s" % job_id, admin=True )
self._assert_has_keys( show_jobs_response.json(), "command_line", "external_id" )
Expand Down

0 comments on commit b2723e7

Please sign in to comment.