You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/09/17 14:23:51 UTC
[airavata] branch develop updated: AIRAVATA-2876 Delete App
Deployment sharing entity when deployment deleted
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 0ba004e AIRAVATA-2876 Delete App Deployment sharing entity when deployment deleted
0ba004e is described below
commit 0ba004e71e87e9c2801b479fc5674d3082a7e8d8
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Sep 17 10:23:19 2018 -0400
AIRAVATA-2876 Delete App Deployment sharing entity when deployment deleted
---
.../airavata/api/server/handler/AiravataServerHandler.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
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 ef70d28..ca385c2 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
@@ -2464,13 +2464,13 @@ public class AiravataServerHandler implements Airavata.Iface {
RegistryService.Client regClient = registryClientPool.getResource();
SharingRegistryService.Client sharingClient = sharingClientPool.getResource();
try {
- if (ServerSettings.isEnableSharing()) {
- final boolean hasAccess = userHasAccessInternal(sharingClient, authzToken, appDeploymentId, ResourcePermissionType.WRITE);
- if (!hasAccess) {
- throw new AuthorizationException("User does not have WRITE access to application deployment " + appDeploymentId);
- }
+ final boolean hasAccess = userHasAccessInternal(sharingClient, authzToken, appDeploymentId, ResourcePermissionType.WRITE);
+ if (!hasAccess) {
+ throw new AuthorizationException("User does not have WRITE access to application deployment " + appDeploymentId);
}
+ final String domainId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID);
boolean result = regClient.deleteApplicationDeployment(appDeploymentId);
+ sharingClient.deleteEntity(domainId, appDeploymentId);
registryClientPool.returnResource(regClient);
sharingClientPool.returnResource(sharingClient);
return result;