diff options
author | Mikael Hammarin <mikael@try2.se> | 2019-10-28 15:48:46 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-04-25 14:37:46 +0200 |
commit | 6ffde74928651db451a8ca23ba440f16f8512681 (patch) | |
tree | 307d4565b876a961191e76c63dba7d71cd041092 /apps/provisioning_api | |
parent | 39f6f1ba341b053f8830571f6f2238c1653cf1ea (diff) | |
download | nextcloud-server-6ffde74928651db451a8ca23ba440f16f8512681.tar.gz nextcloud-server-6ffde74928651db451a8ca23ba440f16f8512681.zip |
Patch to optimize for large installations (>5000 users >20000 groups) where subadmins have access to many of groups (>250)
- UsersController:editUser() calls isUserAccessible() even if the user is admin
This fix reduces API calls to editUser (ex change locale/display name) from >2 minutes (!) to ~3 seconds per call in average.
Signed-off-by: Mikael Hammarin <mikael@try2.se>
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r-- | apps/provisioning_api/lib/Controller/UsersController.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index bd327ffe441..07a1514dd1f 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -504,8 +504,8 @@ class UsersController extends AUserData { } else { // Check if admin / subadmin $subAdminManager = $this->groupManager->getSubAdmin(); - if ($subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser) - || $this->groupManager->isAdmin($currentLoggedInUser->getUID())) { + if ($this->groupManager->isAdmin($currentLoggedInUser->getUID()) + || $subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)) { // They have permissions over the user $permittedFields[] = 'display'; $permittedFields[] = AccountManager::PROPERTY_DISPLAYNAME; |