Skip to content

pass the correct parameters to getManagedUsers #21

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Model/GrouperGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,27 +589,27 @@ public function getGroupMembers(string $actorUserId, string $groupName, array $c
* - the User(me) has a role of owner/admin
* - the User (member User) is a member
*
* @param string $actorUserId
* @param string $userId
* @param string $managerId User(me) has a role of owner/admin
* @param string $userId User (member User) is a member
* @param array $cfg
*
* @return array
* @throws GrouperLiteWidgetException
* @since COmanage Registry v4.4.0
*/
public function getManagedUsers(string $actorUserId, string $userId, array $cfg): array {
if(empty($userId) || empty($actorUserId)) {
public function getManagedUsers(string $managerId, string $userId, array $cfg): array {
if(empty($userId) || empty($managerId)) {
return false;
}

$this->initApi($cfg);

try {
$resultsManagerAdmin = $this->grouperAPI->getUserMemberships($userId,
$actorUserId,
$resultsManagerAdmin = $this->grouperAPI->getUserMemberships($managerId,
$managerId,
GrouperGroupTypeEnum::ADMIN);
$resultsManagerUpdate = $this->grouperAPI->getUserMemberships($userId,
$actorUserId,
$resultsManagerUpdate = $this->grouperAPI->getUserMemberships($managerId,
$managerId,
GrouperGroupTypeEnum::UPDATE);
} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': An error occurred');
Expand All @@ -620,7 +620,7 @@ public function getManagedUsers(string $actorUserId, string $userId, array $cfg)

try {
// Groups the user is a member of
$membersGroup = $this->grouperAPI->getUserGroups($actorUserId, $userId);
$membersGroup = $this->grouperAPI->getUserGroups($managerId, $userId);
} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': An error occurred');
throw $e;
Expand Down