airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/2] airavata-php-gateway git commit: fixing role issue
Date Fri, 11 Mar 2016 20:28:22 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop fd9369ed2 -> 38738a2d1


fixing role issue


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/effe85ea
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/effe85ea
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/effe85ea

Branch: refs/heads/develop
Commit: effe85ea298f20b314ed1187646a7ceef5bafbcb
Parents: 09a65f9
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Fri Mar 11 15:28:09 2016 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Fri Mar 11 15:28:09 2016 -0500

----------------------------------------------------------------------
 app/controllers/AccountController.php | 3 ++-
 app/controllers/AdminController.php   | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/effe85ea/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 199c773..daeaa3c 100755
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -123,7 +123,7 @@ class AccountController extends BaseController
 
             $userProfile = WSIS::getUserProfileFromOAuthToken($accessToken);
             $username = $userProfile['username'];
-            $userRoles = (array)WSIS::getUserRoles($username);
+            $userRoles = $userProfile['roles'];
 
             print_r( $userRoles);
             $authzToken = new Airavata\Model\Security\AuthzToken();
@@ -133,6 +133,7 @@ class AccountController extends BaseController
             Session::put('oauth-refresh-code',$refreshToken);
             Session::put('oauth-expiration-time',$expirationTime);
             Session::put("user-profile", $userProfile);
+            Session::put("roles", $userRoles);
             if (in_array(Config::get('pga_config.wsis')['admin-role-name'], $userRoles))
{
                 Session::put("admin", true);
             }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/effe85ea/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php
index a014a88..e570834 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -130,7 +130,7 @@ class AdminController extends BaseController {
 	}
 
     public function addRolesToUser(){
-        $currentRoles = (array)WSIS::getUserRoles(Input::get("username"));
+        $currentRoles = Session::get('roles');
         $roles["new"] = array_diff(Input::all()["roles"], $currentRoles);
         $roles["deleted"] = array_diff($currentRoles, Input::all()["roles"]);
 
@@ -158,7 +158,7 @@ class AdminController extends BaseController {
     }
 
 	public function getRoles(){
-		return json_encode((array)WSIS::getUserRoles(Input::get("username")));
+		return json_encode(Session::get("roles"));
 	}
 
 	public function deleteRole(){


Mime
View raw message