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>
This commit is contained in:
parent
39f6f1ba34
commit
6ffde74928
|
@ -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;
|
||||
|
|
|
@ -255,6 +255,7 @@ class SubAdmin extends PublicEmitter implements ISubAdmin {
|
|||
if ($this->groupManager->isAdmin($user->getUID())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$accessibleGroups = $this->getSubAdminsGroups($subadmin);
|
||||
foreach ($accessibleGroups as $accessibleGroup) {
|
||||
if ($accessibleGroup->inGroup($user)) {
|
||||
|
|
Loading…
Reference in New Issue