Modifying read-only-admin functionalities

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

Branch: refs/heads/master
Commit: 87a2f235b452eb665d1c7a1383de9ab3933b800e
Parents: f77cd6f
Author: Nipurn Doshi <[email protected]>
Authored: Wed Feb 3 11:14:18 2016 -0500
Committer: Nipurn Doshi <[email protected]>
Committed: Wed Feb 3 11:14:18 2016 -0500

----------------------------------------------------------------------
 app/controllers/AccountController.php       | 3 ++-
 app/views/account/dashboard.blade.php       | 2 +-
 app/views/application/module.blade.php      | 1 -
 app/views/resource/browse.blade.php         | 8 +++-----
 app/views/storage-resource/browse.blade.php | 2 --
 5 files changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/87a2f235/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php 
b/app/controllers/AccountController.php
index a213870..4a6c1bf 100755
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -125,6 +125,7 @@ class AccountController extends BaseController
             $username = $userProfile['username'];
             $userRoles = (array)WSIS::getUserRoles($username);
 
+            print_r( $userRoles);
             $authzToken = new Airavata\Model\Security\AuthzToken();
             $authzToken->accessToken = $accessToken;
             $authzToken->claimsMap = array('userName'=>$username);
@@ -137,6 +138,7 @@ class AccountController extends BaseController
                 Session::put("admin", true);
             }
             if 
(in_array(Config::get('pga_config.wsis')['read-only-admin-role-name'], 
$userRoles)) {
+                Session::put("authorized-user", true);
                 Session::put("admin-read-only", true);
             }
             if (in_array(Config::get('pga_config.wsis')['user-role-name'], 
$userRoles)) {
@@ -147,7 +149,6 @@ class AccountController extends BaseController
             if(  Config::get('pga_config.portal')['super-admin-portal'] == 
true){
                 Session::put("super-admin", true);
             }
-
             CommonUtilities::store_id_in_session($username);
             Session::put("gateway_id", 
Config::get('pga_config.airavata')['gateway-id']);
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/87a2f235/app/views/account/dashboard.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/dashboard.blade.php 
b/app/views/account/dashboard.blade.php
index 2de5b68..530ebe1 100644
--- a/app/views/account/dashboard.blade.php
+++ b/app/views/account/dashboard.blade.php
@@ -65,7 +65,7 @@
                 @endif
             </div>
 
-            @if( Session::has('admin'))
+            @if( Session::has('admin') || Session::has('admin-read-only') )
             <div class="row well">
 
                 <h3>Manage Users Access</h3>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/87a2f235/app/views/application/module.blade.php
----------------------------------------------------------------------
diff --git a/app/views/application/module.blade.php 
b/app/views/application/module.blade.php
index 7ecf4ca..c30752f 100644
--- a/app/views/application/module.blade.php
+++ b/app/views/application/module.blade.php
@@ -208,7 +208,6 @@
 
             $(".edit-app-module").click(function () {
                 var moduleData = $(this).data("module-data");
-                console.log(moduleData);
                 $(".edit-name").val(moduleData.appModuleName);
                 $(".edit-desc").val(moduleData.appModuleDescription);
                 $(".edit-version").val(moduleData.appModuleVersion);

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/87a2f235/app/views/resource/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/resource/browse.blade.php 
b/app/views/resource/browse.blade.php
index 707a0fd..d604d3f 100644
--- a/app/views/resource/browse.blade.php
+++ b/app/views/resource/browse.blade.php
@@ -49,9 +49,9 @@
 
                         <th>Name</th>
                         <th>Id</th>
-                        @if(Session::has("admin"))
-                        <th>Enabled</th>
-                        @endif
+                        <th>
+                            Enabled
+                        </th>
                         <th>View</th>
                         @if(Session::has("super-admin"))
                             <th>Delete</th>
@@ -67,7 +67,6 @@
                     <tr id="crDetails">
                         <td><a href="{{URL::to('/')}}/cr/edit?crId={{ $crId 
}}" title="Edit">{{ $crName }}</a></td>
                         <td>{{ $crId }}</td>
-                        @if(Session::has("admin"))
                         <td>
                             <div class="checkbox">
                                 <input class="resource-status" type="checkbox" 
resourceId="{{$crId}}" @if($enabled) checked @endif
@@ -81,7 +80,6 @@
                                 <span class="glyphicon glyphicon-list"></span>
                             </a>
                         </td>
-                        @endif
                         @if(Session::has("super-admin"))
                             <td>
                             <a href="#" title="Delete">

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/87a2f235/app/views/storage-resource/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/storage-resource/browse.blade.php 
b/app/views/storage-resource/browse.blade.php
index e99d1ed..50fe0a7 100644
--- a/app/views/storage-resource/browse.blade.php
+++ b/app/views/storage-resource/browse.blade.php
@@ -48,9 +48,7 @@
                         <tr>
                             <th>Id</th>
                             <th>Hostname</th>
-                            @if(Session::has("admin"))
                             <th>Enabled</th>
-                            @endif
                             <th>View</th>
                             @if(Session::has("super-admin"))
                             <th>Delete</th>

Reply via email to