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 9953e07 commit d19a74b
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 @@ -158,6 +159,10 @@ def index_query(

stmt = select(self.model_class)

# Do not include pages authored by deleted users
if show_published:
stmt = stmt.join(Page.user).where(and_(User.deleted == false(), User.purged == false()))

filters = []
if show_own or (not show_published and not show_shared and not is_admin):
filters = [self.model_class.user == user]
Expand Down

0 comments on commit d19a74b

Please sign in to comment.