Page MenuHomePhabricator

Create service for checking conditions used by autopromote
Closed, ResolvedPublic

Description

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.

Details

Related Changes in Gerrit:

Event Timeline

Change #1194648 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@master] WIP: Add UserEligibiltyChecker

https://gerrit.wikimedia.org/r/1194648

A new service exists, UserEligibilityChecker (or a better name if there is one)

I guess it's non obvious what it is checking the eligibilty for (namespacing doesn't help; we don't have a MediaWiki\User\Group)...

Change #1194648 merged by jenkins-bot:

[mediawiki/core@master] Add UserRequirementsConditionChecker

https://gerrit.wikimedia.org/r/1194648

The patch has been merged, closing as resolved