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

Make sure you can view your moderated deleted and removed communities. #4912

Merged
merged 5 commits into from
Jul 23, 2024

Conversation

dessalines
Copy link
Member

- The front end checks to see whether you are a mod, in order to be
  able to restore deleted / removed communities. This removes a filter
  which prevents that.
- Fixes #4911
Copy link
Collaborator

@dullbananas dullbananas left a comment

Choose a reason for hiding this comment

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

This change appears to make it possible to see someone else's deleted communities using the read person API, which some people won't like. It's possible to fix this if is_authenticated: bool is replaced with my_local_user: Option<&LocalUser>.

@dessalines
Copy link
Member Author

K fixed. It adds some annoying complication, but it works.

pool: &mut DbPool<'_>,
person_id: PersonId,
is_authenticated: bool,
local_user: Option<&'a LocalUser>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Try removing the 'a lifetime. It should not be needed

.select((community::all_columns, person::all_columns))
.into_boxed();
if !is_authenticated {

if local_user.is_none() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use the LocalUserOptionHelper::visible_communities_only method

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call.

@dessalines dessalines merged commit 32b7319 into main Jul 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleted communities can't be restored after page reload
4 participants