Please note that all submissions to the site are subject to the wiki's licence, CC 4.0 BY-SA, as found here

Abuse filter management

From Consumer Action Taskforce
Abuse Filter navigation (Home | Recent filter changes | Examine past edits | Abuse log)
Jump to navigationJump to search

Differences between versions

ItemVersion from 01:19, 8 January 2025 by LouisVersion from 02:35, 8 January 2025 by Louis
Basic information
Notes:
# Notes for AbuseFilter Rule: Protecting the Stub Notice


## Purpose
This rule prevents non-moderator users (users not in the "sysop" group) from removing the `{{StubNotice}}` template from pages. This ensures that the stub notice remains in place until a moderator reviews and approves its removal.
---
## Rule Explanation
### `removed_lines rlike "{{StubNotice}}"`
- **What it does:**
  - Checks if the edit removes the `{{StubNotice}}` template from the content.
  - The `rlike` operator looks for the exact string `{{StubNotice}}` in the lines removed during the edit.
- **How to modify:**
  - To protect a different template, replace `{{StubNotice}}` with the name of the desired template.
  - Example: To protect `{{ImportantNotice}}`, update to:
    ```plaintext
    removed_lines rlike "{{ImportantNotice}}"
    ```
---
### `!user_groups contains "sysop"`
- **What it does:**
  - Ensures the rule applies only to users who are not in the "sysop" group.
  - The `!` operator negates the condition, meaning users in the "sysop" group are exempt from this restriction.
- **How to modify:**
  - To exempt additional groups, add more checks with the `|` (OR) operator.
  - Example: To also exempt "bureaucrat" users, update to:
    ```plaintext
    !user_groups contains "sysop" | !user_groups contains "bureaucrat"
    ```
---
### Logical Operators
- **`&` (AND):** Combines the conditions. Both conditions must be true for the rule to trigger:
  - The edit must remove the `{{StubNotice}}` template (`removed_lines rlike`).
  - The user must not belong to the "sysop" group (`!user_groups contains "sysop"`).
---
## Summary of What This Rule Does
1. Detects edits that attempt to remove the `{{StubNotice}}` template.
2. Blocks these edits if the user is not in the "sysop" group.
---
## How to Adjust the Rule
1. **Change the Template Being Protected:**
  - Replace `{{StubNotice}}` in `removed_lines rlike` with the desired template name.
  - Ensure the template name matches exactly, including capitalization and braces.
2. **Expand Privileged Groups:**
  - Add more groups to the exemption condition using `|`.
  - Example: To exempt both "sysop" and "editor" groups:
    ```plaintext
    !user_groups contains "sysop" | !user_groups contains "editor"
    ```
3. **Allow Specific Actions for Certain Users:**
  - To allow only specific users (not groups) to remove the notice, you can add a condition for the user's name:
    ```plaintext
    user_name == "SpecificUser"
    ```
---
## Practical Examples
- **Protecting Multiple Templates:**
  ```plaintext
  (removed_lines rlike "{{StubNotice}}" | removed_lines rlike "{{ImportantNotice}}") & !user_groups contains "sysop"
- **Exempting More Groups:**
  ```plaintext
removed_lines rlike "{{StubNotice}}" & !user_groups contains "sysop" | !user_groups contains "bureaucrat"
```