vidakovic commented on code in PR #5648:
URL: https://github.com/apache/fineract/pull/5648#discussion_r2956231340


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/search/service/SearchReadServiceImpl.java:
##########
@@ -51,19 +52,20 @@
 import org.springframework.jdbc.core.RowMapper;
 import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
+import org.springframework.security.core.context.SecurityContextHolder;
 
 @RequiredArgsConstructor
-public class SearchReadPlatformServiceImpl implements 
SearchReadPlatformService {
+public class SearchReadServiceImpl implements SearchReadService {
 
     private final NamedParameterJdbcTemplate namedParameterJdbcTemplate;
-    private final PlatformSecurityContext context;
     private final LoanProductReadPlatformService 
loanProductReadPlatformService;
     private final OfficeReadPlatformService officeReadPlatformService;
     private final DatabaseSpecificSQLGenerator sqlGenerator;
+    private final SqlValidator sqlValidator;
 
     @Override
     public List<SearchData> retriveMatchingData(final SearchConditions 
searchConditions) {
-        final AppUser currentUser = context.authenticatedUser();
+        final AppUser currentUser = (AppUser) 
SecurityContextHolder.getContext().getAuthentication().getPrincipal();

Review Comment:
   I think this should move one level up to the REST resource class and then we 
set the hierarchy as a field/attribute in the search conditions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to