Skip to content

Conversation

@mraman-2U
Copy link

This pull request introduces comprehensive support for discussion moderation, focusing on user banning and improved permissions, as well as adding audit-friendly Django admin interfaces for discussion moderation models. Key changes include enforcing discussion bans at the API level, filtering banned users from course stats, providing admin UIs for bans and exceptions, and sending escalation emails on ban actions. Additionally, permissions logic for moderation actions has been clarified and extended.

Discussion Moderation and Banning:

  • Enforces discussion bans in the API: users who are banned cannot create threads or comments, and the ban status is exposed in API responses. Banned users are also excluded from course discussion user stats. (lms/djangoapps/discussion/rest_api/api.py) [1] [2] [3] [4] [5] [6]
  • Adds Django admin interfaces for DiscussionBan and DiscussionBanException with read-only access for staff and full access for superusers, supporting audit and compliance needs. (lms/djangoapps/discussion/admin.py)
  • Implements email notifications for ban escalation, using ACE if available or falling back to Django email, to alert support teams when a user is banned. (lms/djangoapps/discussion/rest_api/emails.py)

Permissions and Moderation Improvements:

  • Refines and documents moderation permissions, ensuring that only appropriate roles (global staff, course staff/instructors, forum moderators/administrators) can perform bulk delete and ban actions. (lms/djangoapps/discussion/rest_api/permissions.py) [1] [2]

Serializer and Miscellaneous Updates:

  • Updates discussion serializers to expose additional context (e.g., ban status, moderation privilege) and tweaks spam URL filtering logic for improved accuracy. (lms/djangoapps/discussion/rest_api/serializers.py) [1] [2] [3]…user bans

Description

Describe what this pull request changes, and why. Include implications for people using this change.
Design decisions and their rationales should be documented in the repo (docstring / ADR), per
OEP-19, and can be
linked here.

Useful information to include:

  • Which edX user roles will this change impact? Common user roles are "Learner", "Course Author",
    "Developer", and "Operator".
  • Include screenshots for changes to the UI (ideally, both "before" and "after" screenshots, if applicable).
  • Provide links to the description of corresponding configuration changes. Remember to correctly annotate these
    changes.

Supporting information

Link to other information about the change, such as Jira issues, GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.

Testing instructions

Please provide detailed step-by-step instructions for testing this change.

Deadline

"None" if there's no rush, or provide a specific date or event (and reason) if there is one.

Other information

Include anything else that will help reviewers and consumers understand the change.

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, security, or accessibility.
  • If your database migration can't be rolled back easily.

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.

1 participant