Unverified Commit af923d6b authored by davelopez's avatar davelopez
Browse files

Fix anonymous user job retrieval logic

For anonymous users, if a history_id is provided, do not override with the current session history and instead rely on the history accessibility
parent c6930fff
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -127,12 +127,15 @@ class JobManager:
        search = payload.search
        order_by = payload.order_by

        if trans.user is None:
            # If the user is anonymous we can only return jobs for the current session history
            if trans.galaxy_session and trans.galaxy_session.current_history_id:
        if (
            trans.user is None
            and history_id is None
            and trans.galaxy_session
            and trans.galaxy_session.current_history_id
        ):
            # If the user is anonymous and no specific history_id was provided
            # we can only return jobs from the history in the current session
            history_id = trans.galaxy_session.current_history_id
            else:
                return None

        def build_and_apply_filters(stmt, objects, filter_func):
            if objects is not None: