Page MenuHomePhabricator

operations/mediawiki-config - Use UserGroupManager instead of User group methods
Closed, ResolvedPublic

Description

Find all usages of:

  • public function getGroups()
  • public function getGroupMemberships()
  • public function getEffectiveGroups()
  • public function getAutomaticGroups()
  • public function getFormerGroups()
  • public function addGroup()
  • public function removeGroup()
  • public function addAutopromoteOnceGroups()

and need to be replaced with corresponding UserGroupManager methods.
You can obtain UserGroupManager via MediaWikiServices::getInstance()->getUserGroupManager(), but it's preferred to inject it if possible.

Event Timeline

Vlad.shapik created this task.

Change 685032 had a related patch set uploaded (by Zabe; author: Zabe):

[operations/mediawiki-config@master] Avoid using User::getGroups() and ::getGroupMemberships()

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

Change 685032 merged by jenkins-bot:

[operations/mediawiki-config@master] Avoid using User::getGroups() and ::getEffectiveGroups()

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

Mentioned in SAL (#wikimedia-operations) [2021-05-04T23:22:16Z] <urbanecm@deploy1002> Synchronized wmf-config/CommonSettings.php: a3c24f322b754c9a94c260ee5df4b5ae4de27f22: Avoid using User::getGroups() and ::getEffectiveGroups() (T281823) (duration: 01m 10s)

Vlad.shapik renamed this task from operations/mediawiki-config - hard deprecate User group methods to operations/mediawiki-config - Use UserGroupManager instead of User group methods.Thu, May 6, 2:32 PM