Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handling of public pages and workflows authored by deleted users #19394

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

jdavcs
Copy link
Member

@jdavcs jdavcs commented Jan 10, 2025

Ref: #19343

to do:

  • list of public pages: do not display pages authored by deleted users
  • list of public workflows: do not display workflows authored by deleted users
  • public page view: replace purged user hash with "archived user"; remove link
  • public workflow view: same as above

(Please replace this header with a description of your pull request. Please include BOTH what you did and why you made the changes. The "why" may simply be citing a relevant Galaxy issue.)
(If fixing a bug, please add any relevant error or traceback)
(For UI components, it is recommended to include screenshots or screencasts)

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@@ -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()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this allows pages by deleted but not purged users, is that intentional?

Copy link
Member Author

@jdavcs jdavcs Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doesn't: it's an inner join, so by joining we end up selecting only those pages that can be joined with user records where the user is both not deleted and not purged. So, for "user (deleted,purged)", if we have u1 (0,0), u2 (0,1), u3 (1,0), and u4(1,1), then only u1 will be joined, so only pages associated with u1 will be selected.

We check for both deleted and purged because their may be older galaxy
instances with user records that are purged but not deleted.
@jdavcs jdavcs force-pushed the dev_deleted_users_items branch from 3d18f94 to 6611c17 Compare January 10, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants