airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata] branch develop updated: AIRAVATA-3030 Update experiment sharing entity when it changes
Date Wed, 08 May 2019 13:36:58 GMT
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/develop by this push:
     new 660d5dd  AIRAVATA-3030 Update experiment sharing entity when it changes
660d5dd is described below

commit 660d5dd73a516301ff99a45aea7538ade0b36778
Author: Marcus Christie <machristie@apache.org>
AuthorDate: Wed May 8 09:36:44 2019 -0400

    AIRAVATA-3030 Update experiment sharing entity when it changes
---
 .../apache/airavata/api/server/handler/AiravataServerHandler.java  | 7 +++++++
 1 file changed, 7 insertions(+)

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 2bc9318..306d791 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
@@ -1632,12 +1632,19 @@ public class AiravataServerHandler implements Airavata.Iface {
             if(ServerSettings.isEnableSharing() && !authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.USER_NAME).equals(experimentModel.getUserName())
                     || !authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.GATEWAY_ID).equals(experimentModel.getGatewayId())){
                 try {
+                    // Verify WRITE access
                     String gatewayId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID);
                     String userId = authzToken.getClaimsMap().get(Constants.USER_NAME);
                     if (!sharingClient.userHasAccess(gatewayId, userId + "@" + gatewayId,
                             airavataExperimentId, gatewayId + ":WRITE")){
                         throw new AuthorizationException("User does not have permission to
access this resource");
                     }
+                    // Update name, description and parent on Entity
+                    Entity entity = sharingClient.getEntity(gatewayId, airavataExperimentId);
+                    entity.setName(experiment.getExperimentName());
+                    entity.setDescription(experiment.getDescription());
+                    entity.setParentEntityId(experiment.getProjectId());
+                    sharingClient.updateEntity(entity);
                 } catch (Exception e) {
                     throw new AuthorizationException("User does not have permission to access
this resource");
                 }


Mime
View raw message