Hello,
I’ve got a row level policy that works fine with either of two conditions, but not both at the same time.
@JpqlRowLevelPolicy(entityClass = AvailableLoad.class,
where = "{E}.assignedTo is null or {E}.assignedTo.userGroup = :current_user_userGroup")
void availableLoad();
I’ve got another one that does the same thing when one field is null (salespersonAssigned is a nullable field):
@JpqlRowLevelPolicy(entityClass = Lead.class,
where = "{E}.user.userGroup = :current_user_userGroup or {E}.salespersonAssigned.userGroup = :current_user_userGroup")
void lead();
In all cases above, the association attribute (assignedTo, user, and salespersonAssigned) is of my extended user class. There seems to be a problem when the policies are being evaluated with a nullable value. I’ve tried as many combinations as I can think of and can’t get the results I need.
Assistance is appreciated.
Adam