Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3C7F51824C for ; Tue, 9 Feb 2016 15:55:42 +0000 (UTC) Received: (qmail 40300 invoked by uid 500); 9 Feb 2016 15:55:32 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 40053 invoked by uid 500); 9 Feb 2016 15:55:32 -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 38033 invoked by uid 99); 9 Feb 2016 15:55:30 -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; Tue, 09 Feb 2016 15:55:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8158CE04A2; Tue, 9 Feb 2016 15:55:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: scnakandala@apache.org To: commits@airavata.apache.org Date: Tue, 09 Feb 2016 15:56:13 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [45/50] [abbrv] airavata-php-gateway git commit: Fixing permission denied if experiment id belongs to other gateway Fixing permission denied if experiment id belongs to other gateway 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/7f73aebd Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/7f73aebd Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/7f73aebd Branch: refs/heads/master Commit: 7f73aebdd546a4001402f52491f59f79431b532b Parents: be7e471 Author: Nipurn Doshi Authored: Wed Feb 3 12:49:01 2016 -0500 Committer: Nipurn Doshi Committed: Wed Feb 3 12:49:01 2016 -0500 ---------------------------------------------------------------------- app/controllers/ExperimentController.php | 15 ++++- app/views/partials/experiment-info.blade.php | 80 +++-------------------- 2 files changed, 21 insertions(+), 74 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/7f73aebd/app/controllers/ExperimentController.php ---------------------------------------------------------------------- diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php index 704aefb..6dead87 100755 --- a/app/controllers/ExperimentController.php +++ b/app/controllers/ExperimentController.php @@ -86,10 +86,21 @@ class ExperimentController extends BaseController $autoRefresh = false; } if ($experiment != null) { - + $data = array( + "autoRefresh"=> $autoRefresh, + ); //viewing experiments of other gateways is not allowed if user is not super admin - if( $experiment->gatewayId != Session::get("gateway_id") && !Session::has("super-admin")) + if( $experiment->gatewayId != Session::get("gateway_id") && !Session::has("super-admin")){ + Session::put("permissionDenied", true); CommonUtilities::print_error_message('It seems that you do not have permissions to view this experiment or it belongs to another gateway.'); + if (Input::has("dashboard")) + return View::make("partials/experiment-info", array("invalidExperimentId" => 1)); + else + return View::make("experiment/summary", array("invalidExperimentId" => 1)); + } + else + Session::forget("permissionDenied"); + $project = ProjectUtilities::get_project($experiment->projectId); $expVal = ExperimentUtilities::get_experiment_values($experiment, $project); http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/7f73aebd/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 d1b0c12..c2d26d2 100644 --- a/app/views/partials/experiment-info.blade.php +++ b/app/views/partials/experiment-info.blade.php @@ -6,6 +6,11 @@ @else --> + @if( Session::has("permissionDenied" ) ) +
+ {{Session::forget("permissionDenied") }} +
+ @else

Experiment Summary @if( !isset($dashboard)) @@ -214,6 +219,8 @@ @endif + + @endif @if( isset($dashboard)) @@ -285,78 +292,7 @@ - +