SOLR-15073: Fix ClassCastException in SystemInfoHandler.getSecurityInfo.

Same fix as the #2210 PR commit earlier but this time not extending SystemInfoHandlerTest and also not adding a static SystemInfoHandler.getSecurityInfo variant for test use.
This commit is contained in:
Christine Poerschke 2021-01-22 18:33:28 +00:00
parent 64d445bbaa
commit 9d4811e02f
2 changed files with 3 additions and 1 deletions

View File

@ -364,6 +364,8 @@ Bug Fixes
* SOLR-15070: Suggester requests made with SolrJ can now use XMLResponseParser (Jason Gerlowski)
* SOLR-15073: Fix ClassCastException in SystemInfoHandler.getSecurityInfo. (Nikolay Ivanov, Christine Poerschke)
* SOLR-15071: Fix ArrayIndexOutOfBoundsException in contrib/ltr SolrFeatureScorer.
(Florin Babes, Ovidiu Mihalcea, David Smiley, Christine Poerschke)

View File

@ -344,7 +344,7 @@ public class SystemInfoHandler extends RequestHandlerBase
// Mapped roles for this principal
@SuppressWarnings("resource")
AuthorizationPlugin auth = cc==null? null: cc.getAuthorizationPlugin();
if (auth != null) {
if (auth instanceof RuleBasedAuthorizationPluginBase) {
RuleBasedAuthorizationPluginBase rbap = (RuleBasedAuthorizationPluginBase) auth;
Set<String> roles = rbap.getUserRoles(req.getUserPrincipal());
info.add("roles", roles);