[
https://issues.apache.org/jira/browse/AIRAVATA-2601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16277664#comment-16277664
]
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_r154792730
##########
File path:
airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
##########
@@ -2082,9 +2104,23 @@ public boolean updateApplicationModule(AuthzToken
authzToken, String appModuleId
public List<ApplicationModule> getAllAppModules(AuthzToken authzToken,
String gatewayId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
RegistryService.Client regClient = registryClientPool.getResource();
+ String userName = authzToken.getClaimsMap().get(Constants.USER_NAME);
+ SharingRegistryService.Client sharingClient =
sharingClientPool.getResource();
try {
- List<ApplicationModule> result =
regClient.getAllAppModules(gatewayId);
+ List<String> accessibleAppIds = new ArrayList<>();
+ if (ServerSettings.isEnableSharing()) {
+ List<SearchCriteria> sharingFilters = new ArrayList<>();
+ SearchCriteria searchCriteria = new SearchCriteria();
+
searchCriteria.setSearchField(EntitySearchField.ENTITY_TYPE_ID);
+ searchCriteria.setSearchCondition(SearchCondition.EQUAL);
+ searchCriteria.setValue(gatewayId + ":APPLICATION");
+ sharingFilters.add(searchCriteria);
+
sharingClient.searchEntities(authzToken.getClaimsMap().get(Constants.GATEWAY_ID),
+ userName + "@" + gatewayId, sharingFilters, 0,
-1).forEach(a -> accessibleAppIds.add(a.entityId));
+ }
+ List<ApplicationModule> result =
regClient.getAllAppModules(gatewayId, accessibleAppIds);
registryClientPool.returnResource(regClient);
+ sharingClientPool.returnResource(sharingClient);
Review comment:
Same comment about returning the sharingClient in the catch clause.
----------------------------------------------------------------
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)