Page MenuHomePhabricator

Factor group membership management out of User class
Open, MediumPublic

Description

To reduce coupling, functionality related to user group management should be factored out of the User class. Some of the relevant code is already encapsulated in the UserGroupMembership class. UserGroupMembership however should be replaced by (or become) a pure value object.

Proposed design: introduce a UserGroupManager service that offers the following methods:

  • getExpliciteGroups( UserIdentity )
  • getAutomaticGroups( UserIdentity )
  • getEffectiveGroups( UserIdentity )
  • getFormerGroups( UserIdentity )
  • addToGroup( UserIdentity, $group )
  • removeFromGroup( UserIdentity, $group )
  • getGroupLink( $group, UserIdentity|null )

Related Objects

Event Timeline

Change 545690 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] WIP: Create UserGroupManager

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

Change 547029 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/extensions/Wikibase@master] Tests: Don't reuse the same username for users with different groups.

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

Change 547029 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Tests: Don't reuse the same username for users with different groups.

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

Change 552625 had a related patch set uploaded (by Vedmaka Wakalaka; owner: Vedmaka Wakalaka):
[mediawiki/core@master] Adds missing tests for User class related to group management, covers:

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

Change 552625 merged by jenkins-bot:
[mediawiki/core@master] Adds missing tests for User class related to group management, covers:

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

daniel triaged this task as Medium priority.Apr 8 2020, 11:28 AM

Change 588071 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Use UserGroupManager instead of deprecated User methods

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

WDoranWMF added a subscriber: Vedmaka.

Change 545690 merged by jenkins-bot:
[mediawiki/core@master] Create UserGroupManager

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

Change 602695 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] UserGroupManager: add tests for coverage gaps

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

Change 602695 merged by jenkins-bot:
[mediawiki/core@master] UserGroupManager: add tests for coverage gaps

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

Change 604047 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/extensions/CheckUser@master] Use UserGroupManagerFactory with correct domain to fetch groups

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

Change 604047 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] Use UserGroupManagerFactory with correct domain to fetch groups

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

Change 604096 had a related patch set uploaded (by Jforrester; owner: Ppchelko):
[mediawiki/extensions/CheckUser@wmf/1.35.0-wmf.36] Use UserGroupManagerFactory with correct domain to fetch groups

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

Change 604096 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@wmf/1.35.0-wmf.36] Use UserGroupManagerFactory with correct domain to fetch groups

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

Mentioned in SAL (#wikimedia-operations) [2020-06-09T18:13:06Z] <jforrester@deploy1001> Synchronized php-1.35.0-wmf.36/extensions/CheckUser/: T234921 T254912 Use UserGroupManagerFactory with correct domain to fetch groups (duration: 02m 26s)

Change 605323 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Hard-deprecate UserGroupMembership methods replaced by manager

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

Change 605323 merged by jenkins-bot:
[mediawiki/core@master] Hard-deprecate UserGroupMembership methods replaced by manager

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

Change 631927 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Remove all hard-deprecated methods of UserGroupMembership

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

Change 631927 merged by jenkins-bot:
[mediawiki/core@master] Remove all hard-deprecated methods of UserGroupMembership

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

Change 632334 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Remove hard deprecate Autopromote methods

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

Change 632334 abandoned by DannyS712:
[mediawiki/core@master] Remove hard deprecate Autopromote methods

Reason:
only hard deprecated since 1.36

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