This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new 2db0abd Fix missing code from the original hasRole 2db0abd is described below commit 2db0abd4af49cb3bb01cfe20f90049f760252f9f Author: remm <r...@apache.org> AuthorDate: Thu Jun 3 16:49:52 2021 +0200 Fix missing code from the original hasRole Otherwise groups were not considered. No idea why I removed it. Submitted by Carsten Klein. --- java/org/apache/catalina/realm/UserDatabaseRealm.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/realm/UserDatabaseRealm.java b/java/org/apache/catalina/realm/UserDatabaseRealm.java index 181e2ec..f4a86ef 100644 --- a/java/org/apache/catalina/realm/UserDatabaseRealm.java +++ b/java/org/apache/catalina/realm/UserDatabaseRealm.java @@ -273,7 +273,17 @@ public class UserDatabaseRealm extends RealmBase { if (dbrole == null) { return false; } - return user.isInRole(dbrole); + if (user.isInRole(dbrole)) { + return true; + } + Iterator<Group> groups = user.getGroups(); + while (groups.hasNext()) { + Group group = groups.next(); + if (group.isInRole(dbrole)) { + return true; + } + } + return false; } private Object writeReplace() { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org