Background
For T406547: Create service for checking conditions used by autopromote, the new service will need to be able to check conditions for a target user, who may be from an external wiki and may not be the performing user.
It should be able to make use of the UserRequirementsConditionChecker, but this service is currently only used for autopromotion, so it assumes the checks are all being done on a local user who is also performing the request.
Details
How the conditions in ::checkCondition should be handled:
- APCOND_EMAILCONFIRMED, APCOND_EDITCOUNT, APCOND_AGE, APCOND_AGE_FROM_EDIT, APCOND_INGROUPS, APCOND_BLOCKED and APCOND_ISBOT should be checked on the user's wiki
- APCOND_ISIP and APCOND_IPINRANGE should only be checked if the user is performing the request
- AutopromoteConditionHook should document that the hook should handle users from external wikis
Specific challenges:
- Existing handlers of AutopromoteConditionHook should be updated to handle users from external wikis (at first they can just fail the condition if the user is external, and be updated later if necessary)
- ::recursivelyCheckCondition takes a User object, which can only be associated with the local wiki
- APCOND_EMAILCONFIRMED, APCOND_INGROUPS, APCOND_BLOCKED and APCOND_ISBOT probably can't be updated to give reliable answers for external users without using API calls to the external wiki, because they rely on hooks or site configuration