From 3d18f942511616dd96a7a407bccd8f4efa6eda12 Mon Sep 17 00:00:00 2001 From: John Davis Date: Fri, 10 Jan 2025 01:26:07 -0500 Subject: [PATCH] Do not display public pages authored by deleted users We check for both deleted and purged because their may be older galaxy instances with user records that are purged but not deleted. --- lib/galaxy/managers/pages.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/galaxy/managers/pages.py b/lib/galaxy/managers/pages.py index 101d785c688e..334c968f4651 100644 --- a/lib/galaxy/managers/pages.py +++ b/lib/galaxy/managers/pages.py @@ -18,6 +18,7 @@ import sqlalchemy from sqlalchemy import ( + and_, desc, false, func, @@ -168,6 +169,10 @@ def index_query( stmt = stmt.outerjoin(self.model_class.users_shared_with) stmt = stmt.where(or_(*filters)) + # Do not include pages authored by deleted users + if show_published: + stmt = stmt.join(Page.user).where(and_(User.deleted == false(), User.purged == false())) + if payload.user_id: stmt = stmt.where(self.model_class.user_id == payload.user_id)