Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit e5735cc

Browse files
Merge pull request #99 from vyskocilpavel/fix_entitlement
Fix entitlement
2 parents 5c7263c + 2008012 commit e5735cc

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
5+
#### Fixed
6+
- Fixed releasing entitlement for Virtual Organization
7+
- Before: einfra:members
8+
- Now: einfra
9+
510
#### Changed
611
- Releasing forwardedEduPersonEntitlement is now optional (forwardedEduPersonEntitlement are released by default)
712

lib/Auth/Process/PerunEntitlement.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ private function getEduPersonEntitlement(&$request)
114114

115115
$eduPersonEntitlement = [];
116116
foreach ($groups as $group) {
117+
$groupName = $group->getUniqueName();
118+
$groupName = preg_replace('/^(\w*)\:members$/', '$1', $groupName);
119+
117120
if (isset($request['SPMetadata']['groupNameAARC']) || $this->groupNameAARC) {
118121
# https://aarc-project.eu/wp-content/uploads/2017/11/AARC-JRA1.4A-201710.pdf
119122
# Group name is URL encoded by RFC 3986 (http://www.ietf.org/rfc/rfc3986.txt)
@@ -125,10 +128,9 @@ private function getEduPersonEntitlement(&$request)
125128
'\'groupNameAuthority\' or \'groupNamePrefix\'.'
126129
);
127130
}
128-
129-
$groupName = $this->groupNameWrapper($group->getUniqueName());
131+
$groupName = $this->groupNameWrapper($groupName);
130132
} else {
131-
$groupName = $this->mapGroupName($request, $group->getUniqueName());
133+
$groupName = $this->mapGroupName($request, $groupName);
132134
}
133135
array_push($eduPersonEntitlement, $groupName);
134136
}

0 commit comments

Comments
 (0)