Skip to content

Commit 9d4811e

Browse files
committed
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.
1 parent 64d445b commit 9d4811e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

solr/CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ Bug Fixes
364364

365365
* SOLR-15070: Suggester requests made with SolrJ can now use XMLResponseParser (Jason Gerlowski)
366366

367+
* SOLR-15073: Fix ClassCastException in SystemInfoHandler.getSecurityInfo. (Nikolay Ivanov, Christine Poerschke)
368+
367369
* SOLR-15071: Fix ArrayIndexOutOfBoundsException in contrib/ltr SolrFeatureScorer.
368370
(Florin Babes, Ovidiu Mihalcea, David Smiley, Christine Poerschke)
369371

solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ public SimpleOrderedMap<Object> getSecurityInfo(SolrQueryRequest req)
344344
// Mapped roles for this principal
345345
@SuppressWarnings("resource")
346346
AuthorizationPlugin auth = cc==null? null: cc.getAuthorizationPlugin();
347-
if (auth != null) {
347+
if (auth instanceof RuleBasedAuthorizationPluginBase) {
348348
RuleBasedAuthorizationPluginBase rbap = (RuleBasedAuthorizationPluginBase) auth;
349349
Set<String> roles = rbap.getUserRoles(req.getUserPrincipal());
350350
info.add("roles", roles);

0 commit comments

Comments
 (0)