Skip to content

Commit

Permalink
In case no read only groups are defined there is no need in loading t…
Browse files Browse the repository at this point in the history
…he users groups
  • Loading branch information
DeepDiver1975 committed Jul 15, 2019
1 parent 50df15a commit 11106ea
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/private/legacy/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,17 @@ public static function setupFS($user = '') {
if (!\is_array($readOnlyGroups)) {
$readOnlyGroups = [];
}

$userGroups = \array_keys(
\OC::$server->getGroupManager()->getUserIdGroups($user)
);

$readOnlyGroupMemberships = \array_intersect(
$readOnlyGroups,
$userGroups
);
$readOnlyGroupMemberships = [];
if ($readOnlyGroups) {
$userGroups = \array_keys(
\OC::$server->getGroupManager()->getUserIdGroups($user)
);

$readOnlyGroupMemberships = \array_intersect(
$readOnlyGroups,
$userGroups
);
}
}

if ($isGuest === '1' || !empty($readOnlyGroupMemberships)) {
Expand Down

0 comments on commit 11106ea

Please sign in to comment.