shareManager->allowGroupSharing()) { return false; } $userGroups = $this->groupManager->getUserGroups($user); $userGroupNames = array_map(static fn (IGroup $group) => $group->getGID(), $userGroups); $excludeGroupList = json_decode($this->config->getAppValue('core', 'shareapi_exclude_groups_list', '[]'), true); $excludeGroups = $this->config->getAppValue('core', 'shareapi_exclude_groups'); // "no" => Allow sharing for everyone // "yes" => Exclude listed groups from sharing // "allow" => Limit sharing to listed groups return match ($excludeGroups) { 'yes' => count(array_intersect($userGroupNames, $excludeGroupList)) === 0, 'allow' => count(array_intersect($userGroupNames, $excludeGroupList)) > 0, default => true, }; } }