Currently, permission checks are implemented in the Title and User classes. Factoring it out removes baggage from these classes, and helps with resolving the circular dependency between User and Title.
Rough interface draft:
- userCan( UserIdentity, Title, $permission ); // was Title::userCan* andisNamespaceProtected. Could use PageIdentity instead of Title, once we have this.
- isBlockedFrom( UserIdentity, Title, $permission ); // was User::isBlockedFrom. Could use PageIdentity instead of Title, once we have this.
Title::userCan* and User::isBlockedFrom should be deprecated. For the deprecation period, they can delegate to the new service via the global service locator.