Skip to content
Snippets Groups Projects

fix: load groups in user only mode

Merged Pavel Břoušek requested to merge brousek/groups_in_user_only_mode into main
1 file
+ 6
7
Compare changes
  • Side-by-side
  • Inline
@@ -272,9 +272,8 @@ class PerunIdentity extends \SimpleSAML\Auth\ProcessingFilter
$this->registerUrl = $request['SPMetadata'][self::REGISTER_URL];
}
$groups = [];
$user = $this->adapter->getPerunUser($idpEntityId, $uids);
if ($this->useAdditionalIdentifiersLookup && $user === null) {
$additionalIdentifiers =
$request[PerunConstants::ATTRIBUTES][$this->additionalIdentifiersAttribute] ?? null;
@@ -287,16 +286,16 @@ class PerunIdentity extends \SimpleSAML\Auth\ProcessingFilter
$user = $this->adapter->getPerunUserByAdditionalIdentifiers($idpEntityId, $additionalIdentifiers);
}
$groups = $this->entityIdAttr === null ? $this->adapter->getUsersGroupsOnFacility(
$this->spEntityId,
$user->getId()
) : $this->adapter->getUsersGroupsOnFacility($this->spEntityId, $user->getId(), $this->entityIdAttr);
if ($this->mode === self::MODE_FULL) {
$this->getSPAttributes($this->spEntityId);
$this->checkMemberStateDefaultVo($request, $user, $uids);
$groups = $this->entityIdAttr === null ? $this->adapter->getUsersGroupsOnFacility(
$this->spEntityId,
$user->getId()
) : $this->adapter->getUsersGroupsOnFacility($this->spEntityId, $user->getId(), $this->entityIdAttr);
if ($this->checkGroupMembership && empty($groups)) {
if ($this->allowRegistrationToGroups) {
$vosForRegistration = $this->getVosForRegistration($user);
Loading