michael-o 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_r311702448
##########
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:
You probably want a `<RoleMapper class=".." />` with custom attributes. What
makes it different to a listener?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]