Skip to content

Commit 7f35227

Browse files
committed
#12017 leave only ->whereHas(userUserGroups
1 parent 18e0905 commit 7f35227

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

classes/security/Validation.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -503,14 +503,10 @@ public static function getAdministrationLevel(
503503

504504
// single query to fetch user groups assigned to either user
505505
$allUserGroups = UserGroup::query()
506-
->whereHas(
507-
'userUserGroups',
508-
fn ($q) =>
509-
$q->withActive()->withUserIds([$administratorUserId, $administeredUserId])
510-
)
511-
->with(['userUserGroups' => fn ($q) =>
512-
$q->withActive()->withUserIds([$administratorUserId, $administeredUserId])
513-
])
506+
->whereHas('userUserGroups', function ($query) use ($administratorUserId, $administeredUserId) {
507+
$query->withUserIds([$administratorUserId, $administeredUserId])
508+
->withActive();
509+
})
514510
->get();
515511

516512
$administratorMap = [];

0 commit comments

Comments
 (0)