bloritsch 01/07/06 07:10:37
Modified: src/org/apache/cocoon/environment Request.java
Log:
Expose some methods left out of the Request object. These are necessary for
proper Servlet security.
Revision Changes Path
1.2 +35 -1 xml-cocoon2/src/org/apache/cocoon/environment/Request.java
Index: Request.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/Request.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Request.java 2001/05/09 20:49:43 1.1
+++ Request.java 2001/07/06 14:10:34 1.2
@@ -12,13 +12,15 @@
import java.io.UnsupportedEncodingException;
import java.util.Enumeration;
import java.util.Locale;
+import java.security.Principal;
/**
* Defines an interface to provide client request information .
*
* @author <a href="mailto:[EMAIL PROTECTED]">Davanum Srinivas</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.1 $ $Date: 2001/05/09 20:49:43 $
+ * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
+ * @version CVS $Revision: 1.2 $ $Date: 2001/07/06 14:10:34 $
*
*/
@@ -548,6 +550,38 @@
*/
String getRemoteUser();
+
+ /**
+ *
+ * Returns the login of the user making this request, if the
+ * user has been authenticated, or <code>null</code> if the user
+ * has not been authenticated.
+ * Whether the user name is sent with each subsequent request
+ * depends on the browser and type of authentication. Same as the
+ * value of the CGI variable REMOTE_USER.
+ *
+ * @return a <code>String</code> specifying the login
+ * of the user making this request, or <code>null</code
+ * if the user login is not known
+ *
+ */
+
+ Principal getUserPrincipal();
+
+ /**
+ *
+ * Checks whether the currently logged in user is in a specified role.
+ *
+ * @return <code>true</code> if the user is
+ * authenticated and in the role;
+ * otherwise, <code>false</code>
+ *
+ *
+ * @see #getRemoteUser
+ *
+ */
+
+ boolean isUserInRole(String role);
/**
*
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]