Page MenuHomePhabricator

Move User::changeableGroups and User::changeableByGroup to UserGroupManager
Closed, ResolvedPublic

Description

These methods should be moved out of the User class.

  • changeableByGroup - a simple utility wrapper around config variables, no dependencies
  • changeableGroups - depends on UserGroupManager and on PermissionManager. This is problematic, since PermissionManager depends on UserGroupManager, thus moving the method into UGM would create a cyclic dependency. Alternatives: wait for authority object? create a higher-level service depending on both PermManager and UGM. Lazy-load PermissionManager for now.

Event Timeline

@Pchelolo you moved this to Volunteer Needed Tasks but its assigned to you?

hehe. I will maybe look into it later, but not working on it right now. there's still some thinking to be done regarding how to fix a circular dependency.

Potentially, we could split UserGroupManager even further, into UserGroupManager and UserGroupLookup. With the former being responsible for group modification, thus having changeableByGroup and changeableGroups methods, plus add/remove user from group, and purgeExpired, plus addAutopromoteOnceGroups. It will be depending on the PermissionManager. IUserGroupLookup would be an interface, implemented by the UserGroupManager, and with a lighter-weight implementation. This will allow to untie the knot of cyclic dependencies between groups and permissions.

Additional problem with permission manager dependency is that UGM might belong to the foreign wiki, while we can only get an instance of the PermissionManager for the current wiki, but that's a separate can of worms. Technically we need to supply the foreign-wiki UGM with the correct config for that foreign wiki, not just the correct load balancer.

Change 654718 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Move User::changeableGroups and ::changeableByGroup methods.

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

Pchelolo triaged this task as Medium priority.

Change 657419 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Remove usages and hard deprecate User::changeable(By)Group

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

Change 654718 merged by jenkins-bot:
[mediawiki/core@master] Move User::changeable(By)Groups methods to UserGroupManager

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

Change 657419 merged by jenkins-bot:
[mediawiki/core@master] Remove usages and hard deprecate User::changeable(By)Group

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

Change 660023 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Revert "Move User::changeable(By)Groups methods to UserGroupManager"

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

Change 660023 abandoned by Urbanecm:
[mediawiki/core@master] Revert "Move User::changeable(By)Groups methods to UserGroupManager"

Reason:
a dupe of 660006

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

Change 660023 restored by Ppchelko:
[mediawiki/core@master] Revert "Move User::changeable(By)Groups methods to UserGroupManager"

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

Change 660024 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@wmf/1.36.0-wmf.28] Revert "Move User::changeable(By)Groups methods to UserGroupManager"

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

Change 660024 abandoned by Ppchelko:
[mediawiki/core@wmf/1.36.0-wmf.28] Revert "Move User::changeable(By)Groups methods to UserGroupManager"

Reason:

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

Change 660023 merged by jenkins-bot:
[mediawiki/core@master] Revert "Move User::changeable(By)Groups methods to UserGroupManager"

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

Change 660024 restored by Urbanecm:
[mediawiki/core@wmf/1.36.0-wmf.28] Revert "Move User::changeable(By)Groups methods to UserGroupManager"

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

Change 660649 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/core@wmf/1.36.0-wmf.28] Revert "Move User::changeable(By)Groups methods to UserGroupManager"

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

Change 660024 abandoned by Urbanecm:
[mediawiki/core@wmf/1.36.0-wmf.28] Revert "Move User::changeable(By)Groups methods to UserGroupManager"

Reason:
can't figure out how to un-WIP it, uploading new one

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

Change 660649 merged by jenkins-bot:
[mediawiki/core@wmf/1.36.0-wmf.28] Revert "Move User::changeable(By)Groups methods to UserGroupManager"

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

Change 694311 had a related patch set uploaded (by Ppchelko; author: Ppchelko):

[mediawiki/core@master] Move User::changeable(By)Groups methods to UserGroupManager

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

Change 694312 had a related patch set uploaded (by Ppchelko; author: Ppchelko):

[mediawiki/core@master] Remove usages and hard deprecate User::changeable(By)Group

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

Change 694311 merged by jenkins-bot:

[mediawiki/core@master] Move User::changeable(By)Groups methods to UserGroupManager

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

Change 694312 merged by jenkins-bot:

[mediawiki/core@master] Remove usages and hard deprecate User::changeable(By)Group

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