[
https://issues.apache.org/jira/browse/AIRAVATA-2601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16277661#comment-16277661
]
ASF GitHub Bot commented on AIRAVATA-2601:
------------------------------------------
machristie commented on a change in pull request #146: [AIRAVATA-2601] Adding
groups to Applications
URL: https://github.com/apache/airavata/pull/146#discussion_r154792341
##########
File path:
airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
##########
@@ -1747,16 +1761,24 @@ public ExperimentStatus getExperimentStatus(AuthzToken
authzToken, String airava
@Override
@SecurityCheck
public void launchExperiment(AuthzToken authzToken, final String
airavataExperimentId, String gatewayId)
- throws TException {
+ throws AuthorizationException, AiravataSystemException, TException
{
RegistryService.Client regClient = registryClientPool.getResource();
+ SharingRegistryService.Client sharingClient =
sharingClientPool.getResource();
try {
ExperimentModel experiment =
regClient.getExperiment(airavataExperimentId);
+ String userId = authzToken.getClaimsMap().get(Constants.USER_NAME);
+ String entityId = experiment.getExecutionId();
+ if (!sharingClient.userHasAccess(gatewayId, userId + "@" +
gatewayId, entityId,gatewayId + ":READ")) {
+ logger.error(airavataExperimentId, "User does not have access
to application module {}.", entityId);
+ throw new AuthorizationException("User does not have
permission to access this resource");
+ }
if (experiment == null) {
logger.error(airavataExperimentId, "Error while launching
experiment, experiment {} doesn't exist.", airavataExperimentId);
throw new ExperimentNotFoundException("Requested experiment id
" + airavataExperimentId + " does not exist in the system..");
}
submitExperiment(gatewayId, airavataExperimentId);
registryClientPool.returnResource(regClient);
+ sharingClientPool.returnResource(sharingClient);
Review comment:
You should probably return the sharingClient to the pool as a broken
resource, like what is done for the regClient, see line 1787.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Adding Groups to Applications
> -----------------------------
>
> Key: AIRAVATA-2601
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2601
> Project: Airavata
> Issue Type: Improvement
> Components: Registry API
> Reporter: Sneha Tilak
> Assignee: Sneha Tilak
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)