public Set<RoleModel> getScopeMappings() { if (updated != null) return updated.getScopeMappings(); Set<RoleModel> roles = new HashSet<RoleModel>(); for (String id : cached.getScope()) { roles.add(cacheSession.getRoleById(id, getRealm())); } return roles; }
@Override public Set<RoleModel> getClientScopeMappings(ClientModel client) { Set<RoleModel> roleMappings = client.getScopeMappings(); Set<RoleModel> appRoles = new HashSet<RoleModel>(); for (RoleModel role : roleMappings) { RoleContainerModel container = role.getContainer(); if (container instanceof RealmModel) { } else { ClientModel app = (ClientModel) container; if (app.getId().equals(getId())) { appRoles.add(role); } } } return appRoles; }