-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Inject public IGroupManager instead of private GroupManager #8797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inject public IGroupManager instead of private GroupManager #8797
Conversation
|
🤦 Of course it does cause problems with the strict types... I have just realized that Sorry, long night :-) Unfortunately I do not know how to solve this due to the lack of |
|
@danxuliu as a quick fix just remove the strict type declaration for now. |
The public "IGroupManager" service returned by the dependency injection system is automatically initialized with an "OC\Group\Database" backend. However, no backend is automatically set in private "GroupManager" instances. Therefore, a private "GroupManager" instance does not work as expected when initialized through the dependency injection system. Due to that this commit reverts a previous change in which the public "IGroupManager" was replaced by a private "GroupManager" instance. That change was needed when strict types were set, as "getSubAdmin()" is not part of "IGroupManager" API, so the type had to be changed to "GroupManager". Until a better solution is found strict types are disabled again to be able to inject "IGroupManager" and also use "getSubAdmin()". Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
7e4ca46 to
044d5a8
Compare
Codecov Report
@@ Coverage Diff @@
## master #8797 +/- ##
=========================================
Coverage ? 51.87%
Complexity ? 25357
=========================================
Files ? 1607
Lines ? 95100
Branches ? 1377
=========================================
Hits ? 49336
Misses ? 45764
Partials ? 0
|
|
@rullzer Done. |
|
CI for login tests is green and solution was proposed by @rullzer anyways -> merging. |
This pull request fixes a regression introduced in #8743
The public
IGroupManagerservice returned by the dependency injection system is automatically initialized with anOC\Group\Databasebackend. However, no backend is automatically set in privateGroupManagerinstances. Therefore, a privateGroupManagerinstance does not work as expected when initialized through the dependency injection system.For example, an admin can no longer change the password of another user, and creating another user in the admin group does not fully work; although the user is created an error is returned anyway by the server.
Due to that this pull request reverts the changes from #8743 to replace the public "IGroupManager" with a private "GroupManager" instance. It seems that using again the public "IGroupManager" does not cause any problem regarding the strict types, so maybe something else was changed in the meantime that made that previous change no longer needed.