The purpose of this task is to allow application logic to determine restrictions (protection) imposed on a page given only a PageIdentity, without the need to have a Title object. RestrictionStore is to replace the usage of Title::getRestrictions in PermissionManager (see T208768) and other application logic.
Methods to be factored into the new service class:
- Title::loadRestrictionsFromRows should probably just be removed.
- Title::isNamespaceProtected - though perhaps that could go into PermissionManager
- perhaps other methods dealing with restrictions in Title
- finally, WikiPage::doUpdateRestrictions. This needs breaking up. At least the actual interaction with the page_restrictions should be done in PermissionManager. Insertion of the dummy revision should probably stay in WikiPagec for now.
The old methods should be deprecated but kept, delegating any calls to the new service.
- RestrictionStore should bind to PageIdentity instead of Tilte, once PageIdentity identity becomes available (see T208776). Until then, taking a Title object as input is acceptable, but it must only be used to obtain the page ID or the title text and namespace.
- RestrictionStore must not make use of the User class.