Hi all,
I have a custom datastore that gets its data from a restful service. I am able to pull data for all the DTO entities perfectly. I have a requirement to restrict rows of salesorder data based on the businesspartner that login. The user entity has 1-1 relationship with businesspartner entity.
I have this rowlevelrole below that should do the demarcation. However, it does not work, The salesorder rows are displayed for all businesspartners
My question is: does @RowLevelRole work for custom datastore or not? If it does, why is the query below not working? Otherwise, what other way can Jmix handle this case scenario?
Thanks in advance.
@Nonnull
@RowLevelRole(name = "Business Partner Sales Orders", code = "business-partner-sales-order-role")
public interface BusinessPartnerSalesOrderRole {
@JpqlRowLevelPolicy(entityClass = SalesOrder.class,
where = "{E}.customerCode = :current_user_businessPartnerId)"
)
void BusinessPartnerSalesOrder();