DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34625>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34625

           Summary: RequestProcessor.processRoles() broken on Orion 2.0.6
           Product: Struts
           Version: Unknown
          Platform: Other
               URL: http://bugs.orionserver.com/issue/view.jsp?id=1323
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Controller
        AssignedTo: dev@struts.apache.org
        ReportedBy: [EMAIL PROTECTED]


The implementation of HttpServletRequest.isUserInRole() in Orion 2.0.6 throws an
IllegalArgumentException if the role doesn't exist, it breaks the processRoles
method in the RequestProcessor class. I suggest adding a try/catch block inside
the loop iterating over the roles to prevent such an exception from breaking the
processing:

    // Check the current user against the list of required roles
    for (int i = 0; i < roles.length; i++) {
        try {
            if (request.isUserInRole(roles[i])) {
                if (log.isDebugEnabled()) {
                    log.debug(" User '" + request.getRemoteUser() +
                        "' has role '" + roles[i] + "', granting access");
                }
                return (true);
            }
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug(e.getMessage(), e);
            }
        }
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to