Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9DCFF200C1D for ; Wed, 1 Feb 2017 14:36:33 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9C921160B44; Wed, 1 Feb 2017 13:36:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 91F04160B6C for ; Wed, 1 Feb 2017 14:36:32 +0100 (CET) Received: (qmail 80133 invoked by uid 500); 1 Feb 2017 13:36:31 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 79662 invoked by uid 99); 1 Feb 2017 13:36:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2017 13:36:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3B374F4056; Wed, 1 Feb 2017 13:36:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: machristie@apache.org To: commits@airavata.apache.org Date: Wed, 01 Feb 2017 13:36:48 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [19/21] airavata-php-gateway git commit: fixing AIRAVATA-2269 : The gateway admin cannot get access to the gateway even with 'admin' role archived-at: Wed, 01 Feb 2017 13:36:33 -0000 fixing AIRAVATA-2269 : The gateway admin cannot get access to the gateway even with 'admin' role There is a bug in WSO2 IS which doest not return the admin role for the default admin user. Hence as a workaround we manually add it here. 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/e84cc14f Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/e84cc14f Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/e84cc14f Branch: refs/heads/dreg-gateway Commit: e84cc14fa4dc2ecc050accbba62bea60b1dac72d Parents: d9cbd6c Author: scnakandala Authored: Fri Jan 27 11:32:01 2017 -0500 Committer: scnakandala Committed: Fri Jan 27 11:32:01 2017 -0500 ---------------------------------------------------------------------- app/controllers/AccountController.php | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e84cc14f/app/controllers/AccountController.php ---------------------------------------------------------------------- diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index da3a6e7..4b83536 100644 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -180,8 +180,15 @@ class AccountController extends BaseController $userProfile = WSIS::getUserProfileFromOAuthToken($accessToken); $username = $userProfile['username']; + $userRoles = $userProfile['roles']; + //FIXME There is a bug in WSO2 IS which doest not return the admin role for the default admin user. + //FIXME Hence as a workaround we manually add it here. + if ($username == Config::get('pga_config.wsis')['admin-username'] ){ + $userRoles[] = Config::get('pga_config.wsis')['admin-role-name']; + } + $authzToken = new Airavata\Model\Security\AuthzToken(); $authzToken->accessToken = $accessToken; $authzToken->claimsMap = array('userName'=>$username, 'gatewayID'=> Config::get('pga_config.airavata')['gateway-id']);