airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata git commit: fixing AIRAVATA-2175 : Prevent changing project owner
Date Fri, 11 Nov 2016 17:34:30 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 177a2484d -> c456337f2


fixing AIRAVATA-2175 : Prevent changing project owner


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/c456337f
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/c456337f
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/c456337f

Branch: refs/heads/develop
Commit: c456337f23c6833779d454789ee698e0e87b2b24
Parents: 177a248
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Fri Nov 11 12:34:27 2016 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Fri Nov 11 12:34:27 2016 -0500

----------------------------------------------------------------------
 .../airavata/api/server/handler/AiravataServerHandler.java     | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/c456337f/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index a55f926..f90517a 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -731,6 +731,12 @@ public class AiravataServerHandler implements Airavata.Iface {
                     throw new AuthorizationException("User does not have permission to access
this resource");
                 }
             }
+            if(!updatedProject.getOwner().equals(existingProject.getOwner())){
+                throw new InvalidRequestException("Owner of a project cannot be changed");
+            }
+            if(!updatedProject.getGatewayId().equals(existingProject.getGatewayId())){
+                throw new InvalidRequestException("Gateway ID of a project cannot be changed");
+            }
             regClient.updateProject(projectId, updatedProject);
             logger.debug("Airavata updated project with project Id : " + projectId );
         } catch (RegistryServiceException | ApplicationSettingsException e) {


Mime
View raw message