rymghosn opened a new pull request, #6206:
URL: https://github.com/apache/fineract/pull/6206

   **Issue: FineractEntityAccessReadServiceImpl – Invalid SQL Query When User 
Has No Entity Access Mappings**
   
   **Root Cause:**
   In 
`FineractEntityAccessReadServiceImpl#getSQLQueryInClause_WithListOfIDsForEntityAccess`,
 when a user has no entity-access mappings for a specific entity type (for 
example, office-restricted savings products), the method generates a 
comma-separated ID list to be used inside a SQL `IN (...)` clause.
   
   When the access list is empty, the method appends the literal value 
`"false"` instead of a numeric ID. Since the SQL query expects numeric IDs, 
this results in an invalid query and database failure.
   
   **Example Error:**
   
   ```
   PostgreSQL: invalid input syntax for type bigint: "false"
   ```
   
   **Impact:**
   With entity/office-specific access restrictions enabled, users without 
mapped offices for a given entity type cannot create or edit entities filtered 
through this helper (such as savings products). The operation fails instead of 
returning an empty/restricted result set.
   
   **Fix:**
   Replace `"false"` with `"-1"` when the access list is empty.
   
   `-1` is a valid numeric value that does not match any existing entity ID, 
allowing the SQL query to execute successfully while returning zero rows.
   This PR  :(https://issues.apache.org/jira/browse/FINERACT-2726)


-- 
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