Skip to content

Remove obsolete code #13

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
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
11 changes: 0 additions & 11 deletions Controller/GrouperGroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,7 @@ public function beforeFilter()
HttpStatusCodesEnum::HTTP_BAD_REQUEST);
}

$this->Security->unlockedActions = array(
'removeSubscriber',
'addSubscriber',
'joinGroup',
'leaveGroup',
'groupMember',
'groupOptin',
'groupOwner'
);

if ($this->request->is('ajax')) {
$this->response->disableCache();
$this->RequestHandler->addInputType('json', array('json_decode', true));
}

Expand Down
8 changes: 6 additions & 2 deletions Lib/GrouperApiAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ public function getGroupInfo(string $groupName): array
/**
* Returns all the groups the active user is a member of, that they are allowed to see.
*
* THIS REQUEST TARGETS THE GROUPS ENDPOINT
*
* Note: Params added at end make sure that the groups returned can only be viewed by the member logged into
* Grouper Lite
*
Expand All @@ -381,7 +383,7 @@ public function getGroupInfo(string $groupName): array
*
* @throws GrouperLiteWidgetException
*/
public function getUserGroupMemberships(string $actorUserId, string $userId): array
public function getUserGroups(string $actorUserId, string $userId): array
{
if(empty($userId)) {
return [];
Expand All @@ -404,6 +406,8 @@ public function getUserGroupMemberships(string $actorUserId, string $userId): ar
* Returns either the groups the user is able to Opt into or can manage the memberships of.
* Used for requests made to Membership endpoint in Grouper WS
*
* THIS REQUEST TARGETS THE MEMBERSHIP ENDPOINT
*
* @param string $userId
* @param string $actAsUserId
* @param string $groupType
Expand Down Expand Up @@ -439,7 +443,7 @@ public function getUserGroupMemberships(string $actorUserId, string $userId): ar
* }
* }
*/
public function getGrouperUserMemberships(string $userId, string $actAsUserId, string $groupType): array
public function getUserMemberships(string $userId, string $actAsUserId, string $groupType): array
{
if(!in_array($groupType, [
GrouperGroupTypeEnum::OPTINS,
Expand Down
22 changes: 11 additions & 11 deletions Model/GrouperGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public function isUserGroupOwner(string $userId, array $cfg): bool
}

try {
$resultsAdmin = $this->grouperAPI->getGrouperUserMemberships($userId, $userId, GrouperGroupTypeEnum::ADMIN);
$resultsUpdate = $this->grouperAPI->getGrouperUserMemberships($userId, $userId, GrouperGroupTypeEnum::UPDATE);
$resultsAdmin = $this->grouperAPI->getUserMemberships($userId, $userId, GrouperGroupTypeEnum::ADMIN);
$resultsUpdate = $this->grouperAPI->getUserMemberships($userId, $userId, GrouperGroupTypeEnum::UPDATE);
} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': An error occurred');
throw $e;
Expand Down Expand Up @@ -144,7 +144,7 @@ public function filteredMemberOfGroups(string $userId, array $cfg): array
try {
$memberOfGroups = $this->memberOfGroups($userId, $userId, $cfg);
// Determine which groups can be left by user, if wanted.
$optOutGroups = $this->grouperAPI->getGrouperUserMemberships($userId, $userId, GrouperGroupTypeEnum::OPTOUTS);
$optOutGroups = $this->grouperAPI->getUserMemberships($userId, $userId, GrouperGroupTypeEnum::OPTOUTS);
$optOutGroupsNames = Hash::combine($optOutGroups, '{n}.name', '{n}.displayExtension');

foreach ($memberOfGroups as &$memberOfGroup) {
Expand Down Expand Up @@ -282,7 +282,7 @@ private function memberOfGroups(string $actorUserId, string $userId, array $cfg)
$this->initApi($cfg);

try {
return $this->grouperAPI->getUserGroupMemberships($actorUserId, $userId);
return $this->grouperAPI->getUserGroups($actorUserId, $userId);
} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': An error occurred');
throw $e;
Expand All @@ -308,8 +308,8 @@ public function getOwnedGroups(string $userId, array $cfg): array
$this->initApi($cfg);

try {
$resultsAdmin = $this->grouperAPI->getGrouperUserMemberships($userId, $userId, GrouperGroupTypeEnum::ADMIN);
$resultsUpdate = $this->grouperAPI->getGrouperUserMemberships($userId, $userId, GrouperGroupTypeEnum::UPDATE);
$resultsAdmin = $this->grouperAPI->getUserMemberships($userId, $userId, GrouperGroupTypeEnum::ADMIN);
$resultsUpdate = $this->grouperAPI->getUserMemberships($userId, $userId, GrouperGroupTypeEnum::UPDATE);
} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': An error occurred');
throw $e;
Expand All @@ -331,7 +331,7 @@ public function getOwnedGroups(string $userId, array $cfg): array
public function getOwnedStems(string $userId): array
{
try {
return $this->grouperAPI->getGrouperUserMemberships($userId, $userId, GrouperGroupTypeEnum::ADMIN);
return $this->grouperAPI->getUserMemberships($userId, $userId, GrouperGroupTypeEnum::ADMIN);
} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': An error occurred');
throw $e;
Expand Down Expand Up @@ -439,17 +439,17 @@ public function optinGroups(string $userId, array $cfg): array

try {
// Groups the user can join or leave
$joinOrLeave = $this->grouperAPI->getGrouperUserMemberships($userId,
$userId,
GrouperGroupTypeEnum::OPTINS);
$joinOrLeave = $this->grouperAPI->getUserMemberships($userId,
$userId,
GrouperGroupTypeEnum::OPTINS);
} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': An error occurred');
throw $e;
}

try {
// Groups the user is a member of
$userGroups = $this->grouperAPI->getUserGroupMemberships($userId, $userId);
$userGroups = $this->grouperAPI->getUserGroups($userId, $userId);
} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': An error occurred');
throw $e;
Expand Down
75 changes: 0 additions & 75 deletions PlantUML/1.puml

This file was deleted.

25 changes: 0 additions & 25 deletions PlantUML/2.puml

This file was deleted.

46 changes: 0 additions & 46 deletions PlantUML/3.puml

This file was deleted.

64 changes: 0 additions & 64 deletions PlantUML/4.puml

This file was deleted.

Loading