KEYCLOAK-4137 Significant performance lag in 'get client role by role name'

This commit is contained in:
mposolda 2017-01-12 11:55:58 +01:00
parent 23c8809598
commit 9a6f202c46
2 changed files with 2 additions and 8 deletions

View file

@ -569,10 +569,7 @@ public class ClientAdapter implements ClientModel {
@Override @Override
public RoleModel getRole(String name) { public RoleModel getRole(String name) {
for (RoleModel role : getRoles()) { return cacheSession.getClientRole(getRealm(), this, name);
if (role.getName().equals(name)) return role;
}
return null;
} }
@Override @Override

View file

@ -801,10 +801,7 @@ public class RealmAdapter implements CachedRealmModel {
@Override @Override
public RoleModel getRole(String name) { public RoleModel getRole(String name) {
for (RoleModel role : getRoles()) { return cacheSession.getRealmRole(this, name);
if (role.getName().equals(name)) return role;
}
return null;
} }
@Override @Override