You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2005/08/06 18:07:30 UTC
cvs commit: jakarta-tapestry/framework/src/java/org/apache/tapestry/web ServletWebRequest.java WebRequest.java
hlship 2005/08/06 09:07:30
Modified: . status.xml
portlet/src/java/org/apache/tapestry/portlet
PortletWebRequest.java
framework/src/java/org/apache/tapestry/web
ServletWebRequest.java WebRequest.java
Log:
TAPESTRY-534: WebRequest interface doesn't expose getRemoteUser(), isUserInRole() or getUserPrincipal()
Revision Changes Path
1.188 +1 -0 jakarta-tapestry/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs/jakarta-tapestry/status.xml,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -r1.187 -r1.188
--- status.xml 6 Aug 2005 06:58:27 -0000 1.187
+++ status.xml 6 Aug 2005 16:07:29 -0000 1.188
@@ -70,6 +70,7 @@
<action type="fix" dev="PF" fixes-bug="TAPESTRY-407">Unable to override default pattern of DateTranslator and NumberTranslator when initialized via the translator binding.</action>
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-529">Provide application: prefix to reference the application (root) namespace (from a library)</action>
<action type="update" dev="HLS">Enable Eclipse project-specific compile options, active additional checks as errors, and fix those errors in the code base.</action>
+ <action type="fix" dev="HLS" fixes-bug="TAPESTRY-534">WebRequest interface doesn't expose getRemoteUser(), isUserInRole() or getUserPrincipal()</action>
</release>
<release version="4.0-beta-3" date="Jul 22 2005">
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-398" due-to="Jonas Maurus">HiveMind configuration error breaks the useage of the state: binding prefix</action>
1.6 +17 -1 jakarta-tapestry/portlet/src/java/org/apache/tapestry/portlet/PortletWebRequest.java
Index: PortletWebRequest.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/portlet/src/java/org/apache/tapestry/portlet/PortletWebRequest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PortletWebRequest.java 9 Jul 2005 01:38:16 -0000 1.5
+++ PortletWebRequest.java 6 Aug 2005 16:07:29 -0000 1.6
@@ -14,6 +14,7 @@
package org.apache.tapestry.portlet;
+import java.security.Principal;
import java.util.List;
import java.util.Locale;
@@ -27,7 +28,7 @@
import org.apache.tapestry.web.WebUtils;
/**
- * Implementation of {@link org.apache.tapestry.web.WebRequest}that adapts a
+ * Implementation of {@link org.apache.tapestry.web.WebRequest} that adapts a
* {@link PortletRequest).
*
* @author Howard M. Lewis Ship
@@ -152,4 +153,19 @@
return null;
}
+
+ public String getRemoteUser()
+ {
+ return _portletRequest.getRemoteUser();
+ }
+
+ public Principal getUserPrincipal()
+ {
+ return _portletRequest.getUserPrincipal();
+ }
+
+ public boolean isUserInRole(String role)
+ {
+ return _portletRequest.isUserInRole(role);
+ }
}
\ No newline at end of file
1.11 +16 -0 jakarta-tapestry/framework/src/java/org/apache/tapestry/web/ServletWebRequest.java
Index: ServletWebRequest.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/web/ServletWebRequest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ServletWebRequest.java 9 Jul 2005 01:38:15 -0000 1.10
+++ ServletWebRequest.java 6 Aug 2005 16:07:30 -0000 1.11
@@ -15,6 +15,7 @@
package org.apache.tapestry.web;
import java.io.IOException;
+import java.security.Principal;
import java.util.List;
import java.util.Locale;
@@ -201,4 +202,19 @@
{
return _servletRequest.getHeader(name);
}
+
+ public String getRemoteUser()
+ {
+ return _servletRequest.getRemoteUser();
+ }
+
+ public Principal getUserPrincipal()
+ {
+ return _servletRequest.getUserPrincipal();
+ }
+
+ public boolean isUserInRole(String role)
+ {
+ return _servletRequest.isUserInRole(role);
+ }
}
\ No newline at end of file
1.11 +31 -0 jakarta-tapestry/framework/src/java/org/apache/tapestry/web/WebRequest.java
Index: WebRequest.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/web/WebRequest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- WebRequest.java 9 Jul 2005 01:38:15 -0000 1.10
+++ WebRequest.java 6 Aug 2005 16:07:30 -0000 1.11
@@ -149,4 +149,35 @@
*/
public String getHeader(String name);
+
+ /**
+ * Returns the login of the user making this request, if the user has been authenticated, or
+ * null if the user has not been authenticated.
+ *
+ * @return a String specifying the login of the user making this request, or null if the user
+ * login is not known.
+ */
+
+ public String getRemoteUser();
+
+ /**
+ * Returns a java.security.Principal object containing the name of the current authenticated
+ * user.
+ *
+ * @return a java.security.Principal containing the name of the user making this request, or
+ * null if the user has not been authenticated.
+ */
+ public java.security.Principal getUserPrincipal();
+
+ /**
+ * * Returns a boolean indicating whether the authenticated user is included in the specified
+ * logical "role". Roles and role membership can be defined using deployment descriptors. If the
+ * user has not been authenticated, the method returns false.
+ *
+ * @param role
+ * a String specifying the name of the role
+ * @return a boolean indicating whether the user making this request belongs to a given role;
+ * false if the user has not been authenticated.
+ */
+ public boolean isUserInRole(java.lang.String role);
}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org