Hide locked users' profiles from the non-admin people index#1489
Merged
Conversation
Collaborator
|
I wrote up this issue before seeing your PR. #1490 |
Draft
4 tasks
5842ef5 to
29614f7
Compare
29614f7 to
4a9212b
Compare
42ab70f to
9dbb9c9
Compare
Add a where_user_not_locked Person scope and chain it onto the non-admin relation_scope so that profiles whose user account is locked are excluded. People with no user record are still included. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4a9212b to
a4bb4e2
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the goal of this PR and why is this important?
How did you approach the change?
Person.where_user_not_lockedscope:left_joins(:user)so people with no user record are still included, then keeps only rows whereusers.locked_at IS NULL.where_user_not_lockedonto the non-admin branch ofPersonPolicy'srelation_scope, after the existingsearchable.with_active_affiliationsfiltersusers.locked_at IS NULLUI Testing Checklist
profile_is_searchable: true. Confirm that profile no longer appears on/people/peoplestill sees locked users' profilesAnything else to add?
/peopleyet. Keeping them split so the policy change and the visibility-filter change can be reviewed independently