Background
Special:UserRights and Special:GlobalGroupMembership are very similar pages, that allow users to add, remove, or change expiry times for another user's groups.
The PHP classes SpecialUserRights and SpecialGlobalGroupMembership share a lot of code in common, and it is often necessary to update both in parallel when introducing or updating a feature. This is a maintenance burden.
It should be possible for these classes to share a lot of the code, so that it only needs updating in one place.
Technical notes
The execute methods and the methods for form building and processing are very similar.
Form building is done by building HTML directly rather than via component libraries. This should be updated, once the code is shared - T117884.
The main differences between the pages are:
- UserRights has logic to handle which rights the performer can change, whereas GlobalGroupPermissions checks a single right
- GlobalGroupPermissions handles automatic global groups
- UserRights handles cross-wiki target users
- The pages use different services for handling local/global groups, e.g. UserGroupManager vs GlobalGroupLookup
- UserRights expects to be extendable (e.g. canProcessExpiries) - however nothing extends it
- The pages run different hooks from doSaveUserGroups
- The pages use different log types
Acceptance criteria
- Logic is shared between SpecialUserRights and SpecialGlobalGroupMembership where possible
- There are no functional changes to either page