airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata git commit: adding project and experiment search fix for non initialized users
Date Wed, 10 Aug 2016 18:33:18 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 6f1883bf8 -> 3a70c5905


adding project and experiment search fix for non initialized users


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

Branch: refs/heads/develop
Commit: 3a70c590506edd7a2f19edd73e123d979d3f01c8
Parents: 6f1883b
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Wed Aug 10 14:33:13 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Wed Aug 10 14:33:13 2016 -0400

----------------------------------------------------------------------
 .../api/server/handler/AiravataServerHandler.java       |  8 +++++++-
 .../api/service/handler/RegistryServerHandler.java      | 12 ++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/3a70c590/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 5ed43df..68ffa97 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
@@ -3621,7 +3621,13 @@ public class AiravataServerHandler implements Airavata.Iface {
         return accessibleUsers.contains(userId);
     }
 
-    private List<String> getAllAccessibleResourcesForUser(String userId, ResourceType
resourceType, ResourcePermissionType permissionType) throws GroupManagerException {
+    private List<String> getAllAccessibleResourcesForUser(String userId, ResourceType
resourceType, ResourcePermissionType permissionType)
+            throws GroupManagerException, TException, ApplicationSettingsException {
+        if(!getRegistryServiceClient().isUserExists(userId.split("@")[1], userId.split("@")[0])){
+            //user is still not initialized in the sistem
+            return new ArrayList<>();
+        }
+
         GroupManagerCPI groupManager = GroupManagerFactory.getGroupManager();
         org.apache.airavata.grouper.resource.ResourceType gResourceType;
         if(resourceType.equals(ResourceType.PROJECT)){

http://git-wip-us.apache.org/repos/asf/airavata/blob/3a70c590/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
index 948f9ba..7936f7a 100644
--- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
@@ -55,6 +55,7 @@ import org.apache.airavata.registry.core.app.catalog.resources.*;
 import org.apache.airavata.registry.core.app.catalog.util.AppCatalogThriftConversion;
 import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
 import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
+import org.apache.airavata.registry.core.experiment.catalog.resources.AbstractExpCatResource;
 import org.apache.airavata.registry.cpi.*;
 import org.apache.airavata.registry.cpi.utils.Constants;
 import org.apache.thrift.TException;
@@ -3299,6 +3300,11 @@ public class RegistryServerHandler implements RegistryService.Iface
{
             if(accessibleExpIds.size() == 0)
                 return new ArrayList<>();
 
+            if(accessibleExpIds.size() == 0){
+                if(!regFilters.containsKey(AbstractExpCatResource.ExperimentConstants.USER_NAME)){
+                    regFilters.put(AbstractExpCatResource.ExperimentConstants.USER_NAME,
userName);
+                }
+            }
             List<Object> results = experimentCatalog.searchAllAccessible(ExperimentCatalogModelType.EXPERIMENT,
                     accessibleExpIds, regFilters, limit,
                     offset, Constants.FieldConstants.ExperimentConstants.CREATION_TIME, ResultOrderType.DESC);
@@ -3364,6 +3370,12 @@ public class RegistryServerHandler implements RegistryService.Iface
{
             if(accessibleProjIds.size() == 0)
                 return new ArrayList<>();
 
+            if(accessibleProjIds.size() == 0){
+                if(!regFilters.containsKey(AbstractExpCatResource.ProjectConstants.USERNAME)){
+                    regFilters.put(AbstractExpCatResource.ProjectConstants.USERNAME, userName);
+                }
+            }
+
             List<Object> results = experimentCatalog.searchAllAccessible(ExperimentCatalogModelType.PROJECT,
accessibleProjIds,
                     regFilters, limit, offset, Constants.FieldConstants.ProjectConstants.CREATION_TIME,
ResultOrderType.DESC);
             for (Object object : results) {


Mime
View raw message