Correct wrong "No role found" realm debug logging,
authorrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 19 Sep 2008 17:33:22 +0000 (17:33 +0000)
committerrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 19 Sep 2008 17:33:22 +0000 (17:33 +0000)
even if a role was found.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@697158 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/realm/RealmBase.java

index 6f4104e..6556b7d 100644 (file)
@@ -787,9 +787,12 @@ public abstract class RealmBase
                     log.debug("  No user authenticated, cannot grant access");
             } else {
                 for (int j = 0; j < roles.length; j++) {
-                    if (hasRole(principal, roles[j]))
+                    if (hasRole(principal, roles[j])) {
                         status = true;
-                    if( log.isDebugEnabled() )
+                        if( log.isDebugEnabled() )
+                            log.debug( "Role found:  " + roles[j]);
+                    }
+                    else if( log.isDebugEnabled() )
                         log.debug( "No role found:  " + roles[j]);
                 }
             }