Skip to content

Commit

Permalink
Do not display public pages authored by deleted users
Browse files Browse the repository at this point in the history
We check for both deleted and purged because their may be older galaxy
instances with user records that are purged but not deleted.
  • Loading branch information
jdavcs committed Jan 10, 2025
1 parent d023b32 commit 3d18f94
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/galaxy/managers/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import sqlalchemy
from sqlalchemy import (
and_,
desc,
false,
func,
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 3d18f94

Please sign in to comment.