Page MenuHomePhabricator

add pt_user_text to protected_titles table to allow page protection by anon
Open, Stalled, MediumPublicFeature

Description

The protected_titles table does not store the username for the user id.

The table ipblocks stored the username of the admin in ipb_by_text, why does
protected_titles does not store the username of the admin?

Need population script and Renameuser must update the new database field.


Version: 1.18.x
Severity: enhancement

Details

Reference
bz27872

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:34 PM
bzimport set Reference to bz27872.
bzimport added a subscriber: Unknown Object (MLST).

Reopen, because this field is needed to allow anon users/maintenance scripts protecting a title against recreate (Yah, a rare usecase, but why not?). The field should be set only, when the pr_user field is 0, because than that is an anon user.

this field is needed to allow anon users/maintenance scripts protecting a title against recreate

Note that the protect right is ineffective unless you give them also the editprotected right - which makes the usecase even more rare.

Regardless, the field is not needed to provide the functionality since protected_titles.pt_user is not a unique key. Anons are already perfectly able to protect titles assuming they have the necessary rights.

As a side note, even the pt_user column is redundant, so yet another reason against pt_user_text.

Does the software currently allow this grant to be given to anons? If so, what is the error that happens when you try this?

If this isn't currently something possible, I suggest changing the task to instead be about the general feature. Then the scheme change will follow later (and might be done differently, for example, in light of the actor tables).

Krinkle changed the task status from Open to Stalled.Jul 18 2019, 10:11 PM
Krinkle edited projects, added MediaWiki-Page-protection; removed MediaWiki-libs-Rdbms.
Krinkle removed a subscriber: wikibugs-l-list.

How about instead converting pt_user to use a reference to the actor table? I.e. add pt_actor

Does the software currently allow this grant to be given to anons? If so, what is the error that happens when you try this?

If this isn't currently something possible, I suggest changing the task to instead be about the general feature. Then the scheme change will follow later (and might be done differently, for example, in light of the actor tables).

No errors when I granted anon protect and editprotected and tried to protect a title. Can be closed as invalid?

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:24 PM

I instead propose to replace pt_user, pt_reason_id and pt_timestamp with a new column referring to the logging table.