Skip to content

Commit

Permalink
Merge pull request galaxyproject#18746 from mvdbeek/fix_invocation_ac…
Browse files Browse the repository at this point in the history
…cess

Fix workflow invocation accessibility check
  • Loading branch information
mvdbeek authored Aug 30, 2024
2 parents 2f59e59 + f621635 commit 9b010a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/managers/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def get_invocation(
message = f"'{encoded_wfi_id}' is not a valid workflow invocation id"
raise exceptions.ObjectNotFound(message)
self.check_security(
trans, workflow_invocation, check_ownership=check_accessible, check_accessible=check_accessible
trans, workflow_invocation, check_ownership=check_ownership, check_accessible=check_accessible
)
return workflow_invocation

Expand Down
4 changes: 3 additions & 1 deletion lib/galaxy_test/api/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -2857,7 +2857,9 @@ def test_workflow_invocation_report_1(self):
exception_raised = True
assert exception_raised, "Expected workflow report request to fail, but it didn't"
self.dataset_populator.make_public(history_id)
self.workflow_populator.workflow_report_json(workflow_id, invocation_id)
self.workflow_populator.make_public(workflow_id)
with self._different_user():
self.workflow_populator.workflow_report_json(workflow_id, invocation_id)

@skip_without_tool("cat")
def test_workflow_invocation_report_custom(self):
Expand Down
7 changes: 7 additions & 0 deletions lib/galaxy_test/base/populators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2387,6 +2387,13 @@ def _link(link: str, output_name: Optional[str] = None) -> Dict[str, Any]:
link = f"{str(link)}/{output_name}"
return {"$link": link}

def make_public(self, workflow_id: str) -> dict:
using_requirement("new_published_objects")
sharing_response = self._put(f"workflows/{workflow_id}/publish")
api_asserts.assert_status_code_is_ok(sharing_response)
assert sharing_response.status_code == 200
return sharing_response.json()


class CwlPopulator:
def __init__(self, dataset_populator: DatasetPopulator, workflow_populator: WorkflowPopulator):
Expand Down

0 comments on commit 9b010a0

Please sign in to comment.