This is an automated email from the ASF dual-hosted git repository.
taskain 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 977fb2017 [FINERACT-1971] Create delinquency action permission
977fb2017 is described below
commit 977fb201718f425575f9bfb2d0f53f0884fc4010
Author: taskain7 <[email protected]>
AuthorDate: Mon Dec 4 13:42:12 2023 +0100
[FINERACT-1971] Create delinquency action permission
---
.../loanaccount/api/LoansApiResource.java | 3 +-
.../db/changelog/tenant/changelog-tenant.xml | 1 +
...30_add_create_delinquency_action_permission.xml | 32 ++++++++++++++++++++++
3 files changed, 35 insertions(+), 1 deletion(-)
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java
index 7f6da6f65..530e8f105 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java
@@ -243,6 +243,7 @@ public class LoansApiResource {
private static final Set<String> GLIM_ACCOUNTS_DATA_PARAMETERS = new
HashSet<>(Arrays.asList("glimId", "groupId", "clientId",
"parentLoanAccountNo", "parentPrincipalAmount",
"childLoanAccountNo", "childPrincipalAmount", "clientName"));
private static final String RESOURCE_NAME_FOR_PERMISSIONS = "LOAN";
+ private static final String
RESOURCE_NAME_FOR_DELINQUENCY_ACTION_PERMISSIONS = "DELINQUENCY_ACTION";
private final PlatformSecurityContext context;
private final LoanReadPlatformService loanReadPlatformService;
@@ -1222,7 +1223,7 @@ public class LoansApiResource {
}
private String createLoanDelinquencyAction(Long loanId, ExternalId
loanExternalId, String apiRequestBodyAsJson) {
-
context.authenticatedUser().validateHasUpdatePermission(RESOURCE_NAME_FOR_PERMISSIONS);
+
context.authenticatedUser().validateHasCreatePermission(RESOURCE_NAME_FOR_DELINQUENCY_ACTION_PERMISSIONS);
Long resolvedLoanId = getResolvedLoanId(loanId, loanExternalId);
CommandWrapperBuilder builder = new
CommandWrapperBuilder().createDelinquencyAction(resolvedLoanId);
diff --git
a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml
b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml
index 43e6b665a..b71677198 100644
---
a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml
+++
b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml
@@ -149,4 +149,5 @@
<include file="parts/0127_client_name_length.xml"
relativeToChangelogFile="true" />
<include file="parts/0128_savings_audit.xml"
relativeToChangelogFile="true" />
<include
file="parts/0129_transaction_summary_with_asset_owner_report_overpaid_amount.xml"
relativeToChangelogFile="true" />
+ <include file="parts/0130_add_create_delinquency_action_permission.xml"
relativeToChangelogFile="true" />
</databaseChangeLog>
diff --git
a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0130_add_create_delinquency_action_permission.xml
b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0130_add_create_delinquency_action_permission.xml
new file mode 100644
index 000000000..f478c6392
--- /dev/null
+++
b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0130_add_create_delinquency_action_permission.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
+ <changeSet author="fineract" id="1">
+ <insert tableName="m_permission">
+ <column name="grouping" value="organisation" />
+ <column name="code" value="CREATE_DELINQUENCY_ACTION" />
+ <column name="entity_name" value="DELINQUENCY_ACTION" />
+ <column name="action_name" value="CREATE" />
+ <column name="can_maker_checker" valueBoolean="false" />
+ </insert>
+ </changeSet>
+</databaseChangeLog>