Background
For T406544: Create a way to technically enforce policies for restricted groups, we will need a service that can check a user's eligibility against a set of conditions.
As described in T393615#10801569, we can re-use the checks that are already done for autopromote groups. (These include running a hook so extensions can define their own checks.)
Acceptance criteria
- A new service exists, UserEligibilityChecker (or a better name if there is one), which is used by UserGroupManager
- The logic in UserGroupManager::recCheckCondition and ::checkCondition is moved to this service
- No functional changes to autopromote
Notes
UserGroupManager::checkCondition runs the hook AutopromoteCondition, which has a few handlers: https://codesearch.wmcloud.org/search/?q=onAutopromoteCondition&files=&excludeFiles=&repos= . We may wish to rename this later for clarity, but that is beyond the scope of this task.