Row-Level Security Filter for Report Output Based on User's Accessible Customers

Hi Team,

I have a Jmix application where users have access to a limited number of customers based on their role and row-level security. However, I’m facing an issue with the report generation when a user selects “none of the customers” as the input parameter. Currently, the report output includes all customers instead of only the accessible ones.

Here’s the scenario:

  • There are five customers in the system: Customer1, Customer2, Customer3, Customer4, and Customer5.
  • The report has a parameter that allows users to select one or more customers from a list of entities.
  • The security setup ensures that users can access only specific customers based on their role and row-level security.

Expected Behavior:

  • When an admin user generates the report, they can select one or more customers or none of them. In both cases, the report output correctly includes the selected customer records or all customer records, respectively.
  • However, when a regular user (User A) generates the report, they should only see their accessible customers. For example, User A can access only Customer1 and Customer2. If they don’t select any customer from the parameter, the report output should include only Customer1 and Customer2, rather than all five customers.

Issue:

Currently, when User A generates the report without selecting any customer from the parameter, the report output includes all five customers instead of their accessible customers.

Request:

I need assistance in modifying the report query or applying additional filters to ensure that when User A generates the report without selecting any customer, the output includes only their accessible customers (Customer1 and Customer2).

I would appreciate any guidance or suggestions to achieve this behavior.

Thank you in advance for your help! :slightly_smiling_face: