MapRoleProvider uses ILIKE operator when EQ operator should be used

Closes #9130
This commit is contained in:
vramik 2021-12-14 12:38:33 +01:00 committed by Hynek Mlnařík
parent 5f0b65e854
commit 44184ab0cb

View file

@ -200,7 +200,7 @@ public class MapRoleProvider implements RoleProvider {
DefaultModelCriteria<RoleModel> mcb = criteria(); DefaultModelCriteria<RoleModel> mcb = criteria();
mcb = mcb.compare(SearchableFields.REALM_ID, Operator.EQ, realm.getId()) mcb = mcb.compare(SearchableFields.REALM_ID, Operator.EQ, realm.getId())
.compare(SearchableFields.NAME, Operator.ILIKE, name); .compare(SearchableFields.NAME, Operator.EQ, name);
String roleId = tx.read(withCriteria(mcb)) String roleId = tx.read(withCriteria(mcb))
.map(entityToAdapterFunc(realm)) .map(entityToAdapterFunc(realm))
@ -221,7 +221,7 @@ public class MapRoleProvider implements RoleProvider {
DefaultModelCriteria<RoleModel> mcb = criteria(); DefaultModelCriteria<RoleModel> mcb = criteria();
mcb = mcb.compare(SearchableFields.REALM_ID, Operator.EQ, client.getRealm().getId()) mcb = mcb.compare(SearchableFields.REALM_ID, Operator.EQ, client.getRealm().getId())
.compare(SearchableFields.CLIENT_ID, Operator.EQ, client.getId()) .compare(SearchableFields.CLIENT_ID, Operator.EQ, client.getId())
.compare(SearchableFields.NAME, Operator.ILIKE, name); .compare(SearchableFields.NAME, Operator.EQ, name);
String roleId = tx.read(withCriteria(mcb)) String roleId = tx.read(withCriteria(mcb))
.map(entityToAdapterFunc(client.getRealm())) .map(entityToAdapterFunc(client.getRealm()))