diff --git a/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/EffectiveRoleMappingResource.java b/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/EffectiveRoleMappingResource.java index 118c06f3e6..287dd4ad31 100644 --- a/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/EffectiveRoleMappingResource.java +++ b/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/EffectiveRoleMappingResource.java @@ -20,6 +20,7 @@ import org.keycloak.models.ClientScopeModel; import org.keycloak.models.GroupModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; +import org.keycloak.models.RoleModel; import org.keycloak.models.UserModel; import org.keycloak.services.resources.admin.permissions.AdminPermissionEvaluator; @@ -164,7 +165,8 @@ public class EffectiveRoleMappingResource extends RoleMappingResource { )} ) public final List listCompositeRealmRoleMappings() { - return mapping(o -> true).collect(Collectors.toList()); + final RoleModel defaultRole = this.realm.getDefaultRole(); + return mapping(o -> o.hasRole(defaultRole)).collect(Collectors.toList()); } }