Background
Some groups have requirements for members, for example a minimum edit count or enabling 2FA. These are implemented ad hoc, sometimes via software restrictions and sometimes via manual checking. To reduce manual burden on users who assign groups, and to ensure policies are adhered to, investigate building a framework within MediaWiki for configuring user requirements per group.
Questions
Scope:
- Other than temporary-account-ip-viewer and 2FA-requiring groups, which other groups have requirements?
- What are the different ways that group requirements are enforced?
2FA:
- OATHAuth calculates on-the-fly whether a user should be entitled to a group's privileges, based on whether they have 2FA enabled. How would this fit in to a more generic framework? How could we remove a user from a group, or prevent them being added, if they do not meet this requirement?
General technical approach (see also T393615#10801569):
- Can/should we re-use UserGroupManager::recCheckCondition and UserGroupManager::checkCondition?
- How could we handle requirements checking when adding a user to a group? (UserGroupManager::addUserToGroup)
- Can we re-use designs for temporary-account-ip-viewer on Special:UserRights?
- Can we provide a useful error message via ApiUserrights?
- How could we allow performers from certain groups to be exempt from target requirements checking?
- How could we handle requirements checking when checking a user's groups? (UserGroupManager::getUserEffectiveGroups)
- If this fails, how could we remove the user from the group, update the expiry, warn the user, etc?
- Global groups are defined differently (DB table rather than config), and membership is handled by different software (CentralAuth's SpecialGlobalGroupMembership). Name conflicts are allowed between local and global groups. Would any of this be re-usable for global groups, or would it need to be re-implemented?