From 4e455b90c893214a72181f6aa5e85db6eaaebb2f Mon Sep 17 00:00:00 2001
From: jakubs <jakubs>
Date: Wed, 31 Oct 2012 14:57:36 +0000
Subject: [PATCH] SP-365 BIS-245 search service should filter on calling user

SVN: 27435
---
 .../cisd/openbis/dss/etl/PlateGeometryOracle.java        | 6 +++---
 .../ImagingDataSetRegistrationTransactionV2Delegate.java | 6 ++++++
 ...JythonBasedAggregationServiceReportingPluginTest.java | 9 ++++++++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/PlateGeometryOracle.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/PlateGeometryOracle.java
index 0d609c315cd..639af62a27e 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/PlateGeometryOracle.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/PlateGeometryOracle.java
@@ -30,7 +30,7 @@ import ch.systemsx.cisd.etlserver.registrator.DataSetRegistrationDetails;
 import ch.systemsx.cisd.hcs.Location;
 import ch.systemsx.cisd.openbis.dss.etl.dto.api.impl.ImageDataSetInformation;
 import ch.systemsx.cisd.openbis.dss.etl.dto.api.v1.ImageFileInfo;
-import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService;
+import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedBasicOpenBISService;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.VocabularyTerm;
 import ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.Geometry;
 import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ScreeningConstants;
@@ -46,7 +46,7 @@ public class PlateGeometryOracle
 {
     public static String figureGeometry(
             DataSetRegistrationDetails<ImageDataSetInformation> registrationDetails,
-            IEncapsulatedOpenBISService openBisService)
+            IEncapsulatedBasicOpenBISService openBisService)
     {
         List<ImageFileInfo> images =
                 registrationDetails.getDataSetInformation().getImageDataSetStructure().getImages();
@@ -56,7 +56,7 @@ public class PlateGeometryOracle
         return PlateGeometryOracle.figureGeometry(locations, plateGeometries);
     }
 
-    private static List<String> loadPlateGeometries(IEncapsulatedOpenBISService openbisService)
+    private static List<String> loadPlateGeometries(IEncapsulatedBasicOpenBISService openbisService)
     {
         Collection<VocabularyTerm> terms =
                 openbisService.listVocabularyTerms(ScreeningConstants.PLATE_GEOMETRY);
diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/jython/v2/ImagingDataSetRegistrationTransactionV2Delegate.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/jython/v2/ImagingDataSetRegistrationTransactionV2Delegate.java
index 1ee07cb574e..35393209254 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/jython/v2/ImagingDataSetRegistrationTransactionV2Delegate.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/jython/v2/ImagingDataSetRegistrationTransactionV2Delegate.java
@@ -252,6 +252,12 @@ public class ImagingDataSetRegistrationTransactionV2Delegate implements
         return transaction.getSearchService();
     }
 
+    @Override
+    public ISearchService getSearchServiceUnfiltered()
+    {
+        return transaction.getSearchServiceUnfiltered();
+    }
+
     @Override
     public IAuthorizationService getAuthorizationService()
     {
diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/screening/server/plugins/jython/ScreeningJythonBasedAggregationServiceReportingPluginTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/screening/server/plugins/jython/ScreeningJythonBasedAggregationServiceReportingPluginTest.java
index 127cbac8d0c..bb44f83e357 100644
--- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/screening/server/plugins/jython/ScreeningJythonBasedAggregationServiceReportingPluginTest.java
+++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/screening/server/plugins/jython/ScreeningJythonBasedAggregationServiceReportingPluginTest.java
@@ -119,7 +119,14 @@ public class ScreeningJythonBasedAggregationServiceReportingPluginTest extends
                         private static final long serialVersionUID = 1L;
 
                         @Override
-                        protected ISearchService createSearchService()
+                        protected ISearchService createUnfilteredSearchService()
+                        {
+                            return searchService;
+                        }
+
+                        @Override
+                        protected ISearchService createUserSearchService(
+                                DataSetProcessingContext dscontext)
                         {
                             return searchService;
                         }
-- 
GitLab