Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #21 from Ioannis/Fix_users_i_manage_params
pass the correct parameters to getManagedUsers
aaschenbrener committed Apr 8, 2024
2 parents 2bd1a43 + fbf35bf commit 460b331
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Model/GrouperGroup.php
@@ -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');
@@ -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;

0 comments on commit 460b331

Please sign in to comment.