You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2003/10/15 17:54:08 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/ac2 PolicyAuthorizer.java
andreas 2003/10/15 08:54:08
Modified: src/java/org/apache/lenya/cms/ac2 PolicyAuthorizer.java
Log:
Refined exception message for "Request does not contain roles"
Revision Changes Path
1.16 +9 -2 cocoon-lenya/src/java/org/apache/lenya/cms/ac2/PolicyAuthorizer.java
Index: PolicyAuthorizer.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/ac2/PolicyAuthorizer.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- PolicyAuthorizer.java 12 Sep 2003 16:46:50 -0000 1.15
+++ PolicyAuthorizer.java 15 Oct 2003 15:54:08 -0000 1.16
@@ -56,6 +56,7 @@
package org.apache.lenya.cms.ac2;
import java.util.Arrays;
+import java.util.Enumeration;
import java.util.List;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
@@ -200,7 +201,13 @@
List roleList = (List) request.getAttribute(Role.class.getName());
if (roleList == null) {
- throw new AccessControlException("Request does not contain roles!");
+ String message = " URI: [" + request.getRequestURI() + "]\n";
+ for (Enumeration e = request.getParameterNames(); e.hasMoreElements(); ) {
+ String key = (String) e.nextElement();
+ message += " Parameter: [" + key + "] = [" + request.getParameter(key) + "]\n";
+ }
+
+ throw new AccessControlException("Request [" + request + "] does not contain roles: \n" + message);
}
Role[] roles = (Role[]) roleList.toArray(new Role[roleList.size()]);
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org