removing IS tenant removal from Group utilities
Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/0d34e174 Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/0d34e174 Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/0d34e174 Branch: refs/heads/develop Commit: 0d34e1740054468f17760dfa81b37971d04ea96b Parents: f55323c Author: scnakandala <[email protected]> Authored: Fri Mar 24 11:26:22 2017 -0400 Committer: scnakandala <[email protected]> Committed: Fri Mar 24 11:26:22 2017 -0400 ---------------------------------------------------------------------- app/libraries/GrouperUtilities.php | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0d34e174/app/libraries/GrouperUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/GrouperUtilities.php b/app/libraries/GrouperUtilities.php index 62714f4..3af5cba 100644 --- a/app/libraries/GrouperUtilities.php +++ b/app/libraries/GrouperUtilities.php @@ -23,12 +23,7 @@ class GrouperUtilities { $newUserPermissionsMap = []; foreach($userPermissionMap as $key=> $value){ - if (strpos($key, '@') !== false) { - $parts = explode('@', $key); - $key = join('@', array_slice($parts, 0, -1)) . "@" . Config::get('pga_config.airavata')['gateway-id']; - }else{ - $key = $key . "@" . Config::get('pga_config.airavata')['gateway-id']; - } + $key = $key . "@" . Config::get('pga_config.airavata')['gateway-id']; $newUserPermissionsMap[$key] = $value; } Airavata::shareResourceWithUsers(Session::get('authz-token'), $resourceId, $dataResourceType, $newUserPermissionsMap); @@ -43,12 +38,7 @@ class GrouperUtilities { $newUserPermissionsMap = []; foreach($userPermissionMap as $key=> $value){ - if (strpos($key, '@') !== false) { - $parts = explode('@', $key); - $key = join('@', array_slice($parts, 0, -1)) . "@" . Config::get('pga_config.airavata')['gateway-id']; - }else{ - $key = $key . "@" . Config::get('pga_config.airavata')['gateway-id']; - } + $key = $key . "@" . Config::get('pga_config.airavata')['gateway-id']; $newUserPermissionsMap[$key] = $value; } Airavata::revokeSharingOfResourceFromUsers(Session::get('authz-token'), $resourceId, $dataResourceType, $newUserPermissionsMap); @@ -79,12 +69,7 @@ class GrouperUtilities * @param $group Airavata/Model/Group/GrouoModel */ public static function createGroup($group){ - if (strpos($group->ownerId, '@') !== false) { - $parts = explode('@', $group->ownerId); - $group->ownerId = join('@', array_slice($parts, 0, -1)) . "@" . Config::get('pga_config.airavata')['gateway-id']; - }else{ - $group->ownerId = $group->ownerId . "@" . Config::get('pga_config.airavata')['gateway-id']; - } + $group->ownerId = $group->ownerId . "@" . Config::get('pga_config.airavata')['gateway-id']; Airavata::createGroup(Session::get('authz-token'),$group); } @@ -93,12 +78,7 @@ class GrouperUtilities * @param $group Airavata/Model/Group/GrouoModel */ public static function updateGroup($group){ - if (strpos($group->ownerId, '@') !== false) { - $parts = explode('@', $group->ownerId); - $group->ownerId = join('@', array_slice($parts, 0, -1)) . "@" . Config::get('pga_config.airavata')['gateway-id']; - }else{ - $group->ownerId = $group->ownerId . "@" . Config::get('pga_config.airavata')['gateway-id']; - } + $group->ownerId = $group->ownerId . "@" . Config::get('pga_config.airavata')['gateway-id']; Airavata::updateGroup(Session::get('authz-token'),$group); } @@ -108,11 +88,6 @@ class GrouperUtilities * @param $ownerName */ public static function deleteGroup($groupId, $ownerName){ - if (strpos($ownerName, '@') !== false) { - $parts = explode('@', $ownerName); - $ownerName = join('@', array_slice($parts, 0, -1)); - } - Airavata::deleteGroup(Session::get('authz-token'), $groupId, $ownerName, Config::get('pga_config.airavata')['gateway-id']); }
