Merge pull request #3743 from mposolda/master

KEYCLOAK-4137 Significant performance lag in 'get client role by role…
This commit is contained in:
Marek Posolda 2017-01-12 12:48:23 +01:00 committed by GitHub
commit 5e1ec459e5
2 changed files with 2 additions and 8 deletions

View file

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

View file

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