Problem to solve
Full site blocks are not always appropriate in all cases of user misconduct.
Proposed solution
To retain constructive contributors who cause disruption on one page (e.g. contentious article page, user talk page of someone they constantly berate, etc.) we could give admins the ability to block them from editing one specific page or all articles inside a namespace.
Acceptance criteria
- On Special:Block, add a radio button to select setting the block as sitewide vs. partial.
- When a block is saved with the sitewide radio button selected, the block should behave exactly as it does today.
- If the partial radio button is selected, the admin should be able to provide a list of pages and/or namespaces:
- If an admin specifies page(s) to block:
- Page blocks can only be set for existing pages only, with validation required in the input field.
- An autosuggest should help the admin find the correct page.
- Pages can be from any namespace
- If a page is moved or deleted, the user should still be blocked from editing that page (i.e. block by page ID, not page name)
- If an admin specifies namespace(s) to block:
- The input field should only accept valid namespaces, with validation required in the input field.
- An autosuggest should help the user find the correct namespace.
- If an admin specifies page(s) to block:
- Help tooltips should display for the new fields
- Block log entries on Special:Contributions, Special:Block, and Special:Log should be indicate if the block is partial:
- Log for sitewide blocks should not change.
- Log for page blocks should include TIMESTAMP Admin-who-blocked (t|c|b) blocked BadApples (t|c) from editing the page(s) Foobar with an expiration time of N (reason) (unblock | change block)
- Log for namespace blocks should include TIMESTAMP Admin-who-blocked (t|c|b) blocked BadApples (t|c) from editing the namespace(s) Foobar with an expiration time of N (reason) (unblock | change block)
- Log for both page and namespace blocks should include TIMESTAMP Admin-who-blocked (t|c|b) blocked BadApples (t|c) from editing the page(s) Foobar and namespace(s) Foobar2 with an expiration time of N (reason) (unblock | change block)
- The block should be listed and annotated on Special:BlockList, per the designs
- When a user attempts to edit an applicable page, they should see a new type of block warning message using a new string key which includes information on their block (reason, expiration, etc.)
- Only one block per user (like it is today) — to update the block, admins will need to modify the block.
- If a partial block is set, the checkbox for Prevent this user from editing his own talk page while blocked should be marked as disabled
- The Block API should be updated to support all partial block functionality
- Sitewide blocking via API should not change
- API documentation should be updated
- If a partial block is set via API, invalid pages and namespaces should be ignored
Hyperlinks
- 2015 Community Wishlist survey proposal, where it received 52 support votes, and was ranked #14 out of 107 proposals.
- Per user page block documentation on Meta Wiki
Designs
Technical Plan
- Schema Changes. The details can be found in T193449 and the patch is available in T197144.
- Add table ipblocks_restrictions
- Add column ipb_sitewide to ipblocks
- API Changes
- Update API:Blocks and API:Userinfo(?) to list the details of the partial block T197141
- Edit endpoints will throw an appropriate error when an edit is made to a blocked page or namespace T197117
- Update API:Block to allow partial blocks to be set via the API T197111
We'll allow the user (via the API or Special:Block) to set the ipb_sitewide flag (a boolean) and then specify the pages or namespaces they want to restrict, which will be stored in ipblocks_restrictions. The restrictions will need to be listed anywhere we currently list the blocks (Special:BlockList, Block Log, Contributions, etc.). We'll also enforce the block by modifying User::isBlockedFrom() to check if the block is sitewide or not and if not to check to see if the page is on the restrictions list. Finally, we'll update the block notices the user gets so that it is page specific.