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 {
|
} else {
|
||||||
// Check if admin / subadmin
|
// Check if admin / subadmin
|
||||||
$subAdminManager = $this->groupManager->getSubAdmin();
|
$subAdminManager = $this->groupManager->getSubAdmin();
|
||||||
if ($subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)
|
if ($this->groupManager->isAdmin($currentLoggedInUser->getUID())
|
||||||
|| $this->groupManager->isAdmin($currentLoggedInUser->getUID())) {
|
|| $subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)) {
|
||||||
// They have permissions over the user
|
// They have permissions over the user
|
||||||
$permittedFields[] = 'display';
|
$permittedFields[] = 'display';
|
||||||
$permittedFields[] = AccountManager::PROPERTY_DISPLAYNAME;
|
$permittedFields[] = AccountManager::PROPERTY_DISPLAYNAME;
|
||||||
|
|
|
@ -255,6 +255,7 @@ class SubAdmin extends PublicEmitter implements ISubAdmin {
|
||||||
if ($this->groupManager->isAdmin($user->getUID())) {
|
if ($this->groupManager->isAdmin($user->getUID())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$accessibleGroups = $this->getSubAdminsGroups($subadmin);
|
$accessibleGroups = $this->getSubAdminsGroups($subadmin);
|
||||||
foreach ($accessibleGroups as $accessibleGroup) {
|
foreach ($accessibleGroups as $accessibleGroup) {
|
||||||
if ($accessibleGroup->inGroup($user)) {
|
if ($accessibleGroup->inGroup($user)) {
|
||||||
|
|
Loading…
Reference in New Issue