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

Limit moderation access to specific group #6388

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

akatsoulas
Copy link
Collaborator

No description provided.

Copy link
Contributor

@escattone escattone left a comment

Choose a reason for hiding this comment

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

Nicely done, thanks @akatsoulas! I just have a small comment.

Comment on lines +114 to +121
if only_active:
if not (
request.user.is_active and request.user.groups.filter(name=group_name).exists()
):
raise Http404
else:
if not request.user.groups.filter(name=group_name).exists():
raise Http404
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit. What do you think of the following instead?

            if not (
                (!only_active or request.user.is_active) and request.user.groups.filter(name=group_name).exists()
            ):
                raise Http404
@akatsoulas akatsoulas merged commit d144a38 into mozilla:main Dec 4, 2024
2 checks passed
@akatsoulas akatsoulas deleted the moderation-group branch December 4, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants