markt-asf commented on a change in pull request #186: BZ 63636: Context#findRoleMapping() never called in RealmBase#hasRole() URL: https://github.com/apache/tomcat/pull/186#discussion_r311457083
########## File path: test/org/apache/catalina/realm/TestRealmBase.java ########## @@ -789,4 +791,45 @@ public void testHttpConstraint() throws IOException { Assert.assertFalse(mapRealm.hasResourcePermission( request, response, constraintsDelete, null)); } + + @Test + public void testRoleMapping() throws Exception { + Context context = new TesterContext() { + private Map<String, String> roleMapping = new HashMap<>(); + + public void addRoleMapping(String role, String link) { + roleMapping.put(role, link); + } + + @Override + public String findRoleMapping(String role) { + return roleMapping.get(role); + } + }; + + context.addRoleMapping(ROLE2, "very-complex-role-name"); Review comment: The only way to add these Context mappings (currently) is via code. There is no mechanism to do this via configuration. Possibly as a separate enhancement, consider adding such an option. See https://bz.apache.org/bugzilla/show_bug.cgi?id=55477 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org