Page MenuHomePhabricator

WikiPage::doUpdateRestrictions should become a page command
Open, Needs TriagePublic


The following methods of WikiPage class are related to updating a page restriction:

  • doUpdateRestrictions - this should become a page command, something like RestrictPage or ProtectPage. I kinda like ProtectPage more.
  • insertNullProtectionRevision - should be private in the new command. There's no reason for it to be public
  • protectDescription, formatExpiry, protectDescriptionLog should become private in the new command.

The code that is actually inserting into the page_restrictions and protected_titles tables should live in RestrictionStore. Since it's not very safe to expose insertions to these tables, the new methods should probably be @internal

The new command should be covered by tests. WikiPage methods have reasonable coverage, so perhaps we can first rely on old tests, and then in a next patch adapt the tests.