This is an automated email from the ASF dual-hosted git repository.

arnold pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new c8d7f9397 FINERACT-1724: Improvements around maker-checker check
c8d7f9397 is described below

commit c8d7f9397ba8b0e05c1d1ee4f1714f771f9ef0f2
Author: Adam Saghy <[email protected]>
AuthorDate: Fri Mar 31 00:13:51 2023 +0200

    FINERACT-1724: Improvements around maker-checker check
---
 .../domain/ConfigurationDomainServiceJpa.java             | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java
index a278c1c5c..88dd26da5 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java
@@ -60,16 +60,17 @@ public class ConfigurationDomainServiceJpa implements 
ConfigurationDomainService
         if (StringUtils.isBlank(taskPermissionCode)) {
             throw new PermissionNotFoundException(taskPermissionCode);
         }
-
-        final Permission thisTask = 
this.permissionRepository.findOneByCode(taskPermissionCode);
-        if (thisTask == null) {
-            throw new PermissionNotFoundException(taskPermissionCode);
-        }
-
         final String makerCheckerConfigurationProperty = "maker-checker";
         final GlobalConfigurationPropertyData property = 
getGlobalConfigurationPropertyData(makerCheckerConfigurationProperty);
+        if (property.isEnabled()) {
+            final Permission thisTask = 
this.permissionRepository.findOneByCode(taskPermissionCode);
+            if (thisTask == null) {
+                throw new PermissionNotFoundException(taskPermissionCode);
+            }
 
-        return thisTask.hasMakerCheckerEnabled() && property.isEnabled();
+            return thisTask.hasMakerCheckerEnabled();
+        }
+        return false;
     }
 
     @Override

Reply via email to