airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/7] airavata-php-gateway git commit: AIRAVATA-2190 Project no longer automatically shared
Date Fri, 04 Nov 2016 17:55:23 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 693db4ee5 -> 35a9e8e50


AIRAVATA-2190 Project no longer automatically shared

When experiment is shared with a user, project is no longer
automatically also shared, which was a workaround on the PGA side for a
data sharing issue that no longer exists with the current implementation.


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

Branch: refs/heads/develop
Commit: 0455ebd7f3d0a2214e901b9f29b915046b65b620
Parents: 693db4e
Author: Marcus Christie <machrist@iu.edu>
Authored: Wed Nov 2 15:58:32 2016 -0400
Committer: Marcus Christie <machrist@iu.edu>
Committed: Wed Nov 2 15:59:55 2016 -0400

----------------------------------------------------------------------
 app/controllers/ExperimentController.php     |  5 ++++-
 app/libraries/ExperimentUtilities.php        | 19 -------------------
 app/views/partials/experiment-info.blade.php |  6 +++++-
 3 files changed, 9 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0455ebd7/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index d7fb40c..4dfc24f 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -123,7 +123,10 @@ class ExperimentController extends BaseController
                 Session::forget("permissionDenied");
 
 
-            $project = ProjectUtilities::get_project($experiment->projectId);
+            $project = null;
+            if (SharingUtilities::userCanRead(Session::get("username"), $experiment->projectId,
ResourceType::PROJECT)) {
+                $project = ProjectUtilities::get_project($experiment->projectId);
+            }
             $expVal = ExperimentUtilities::get_experiment_values($experiment);
             $jobDetails = ExperimentUtilities::get_job_details($experiment->experimentId);
 //            var_dump( $jobDetails); exit;

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0455ebd7/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index 26f555b..32f4323 100755
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -1355,10 +1355,6 @@ class ExperimentUtilities
         $radd = array();
         $rrevoke = array();
 
-        $projperms = GrouperUtilities::getAllAccessibleUsers($experiment->projectId, ResourceType::PROJECT,
ResourcePermissionType::READ);
-        $prrevoke = array();
-        $pwrevoke = array();
-
         foreach ($users as $user => $perms) {
             if ($perms->write) {
                 $wadd[$user] = ResourcePermissionType::WRITE;
@@ -1373,11 +1369,6 @@ class ExperimentUtilities
             else {
                 $rrevoke[$user] = ResourcePermissionType::READ;
             }
-
-            if (array_search($user, $projperms) === false) {
-                $prrevoke[$user] = ResourcePermissionType::READ;
-                $pwrevoke[$user] = ResourcePermissionType::WRITE;
-            }
         }
 
         GrouperUtilities::shareResourceWithUsers($expId, ResourceType::EXPERIMENT, $wadd);
@@ -1385,15 +1376,5 @@ class ExperimentUtilities
 
         GrouperUtilities::shareResourceWithUsers($expId, ResourceType::EXPERIMENT, $radd);
         GrouperUtilities::revokeSharingOfResourceFromUsers($expId, ResourceType::EXPERIMENT,
$rrevoke);
-
-        GrouperUtilities::shareResourceWithUsers($experiment->projectId, ResourceType::PROJECT,
$radd);
-
-        $experiments = ProjectUtilities::get_experiments_in_project($experiment->projectId);
-        foreach ($experiments as $exp) {
-            if ($exp->experimentId !== $expId) {
-                GrouperUtilities::revokeSharingOfResourceFromUsers($exp->experimentId,
ResourceType::EXPERIMENT, $prrevoke);
-                GrouperUtilities::revokeSharingOfResourceFromUsers($exp->experimentId,
ResourceType::EXPERIMENT, $pwrevoke);
-            }
-        }
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0455ebd7/app/views/partials/experiment-info.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-info.blade.php b/app/views/partials/experiment-info.blade.php
index 2bba34c..d66e8b7 100644
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@ -46,7 +46,11 @@
         </tr>
         <tr>
             <td><strong>Project</strong></td>
-            <td><?php echo $project->name; ?></td>
+            @if (isset($project))
+            <td>{{{ $project->name }}}</td>
+            @else
+            <td><em>You don't have access to this project.</em></td>
+            @endif
         </tr>
         <tr>
             <td><strong>Owner</strong></td>


Mime
View raw message