Skip to content

Commit

Permalink
[24.0] Prevent inactive users from running workflows
Browse files Browse the repository at this point in the history
Only in the case if `config.user_activation_on = True`
Fixes galaxyproject#18147
  • Loading branch information
ahmedhamidawan committed May 21, 2024
1 parent bf02164 commit 5edab06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/galaxy/managers/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def user_can_do_run_as(self) -> bool:

@property
def user_is_active(self) -> bool:
return not self.app.config.user_activation_on or self.user is None or self.user.active
return not self.app.config.user_activation_on or (self.user is not None and self.user.active)

def check_user_activation(self):
"""If user activation is enabled and the user is not activated throw an exception."""
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/webapps/galaxy/services/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def invoke_workflow(
workflow_id,
payload: InvokeWorkflowPayload,
) -> Union[WorkflowInvocationResponse, List[WorkflowInvocationResponse]]:
trans.check_user_activation()
# Get workflow + accessibility check.
by_stored_id = not payload.instance
stored_workflow = self._workflows_manager.get_stored_accessible_workflow(trans, workflow_id, by_stored_id)
Expand Down

0 comments on commit 5edab06

Please sign in to comment.