You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by dd...@apache.org on 2004/07/30 20:45:48 UTC

cvs commit: jakarta-pluto/testsuite/src/webapp/jsp test10.jsp test9.jsp

ddewolf     2004/07/30 11:45:48

  Modified:    testsuite/src/webapp/jsp test9.jsp
  Added:       testsuite/src/webapp/jsp test10.jsp
  Log:
  Fixing Issue: PLUTO-46.  isUserInRole now checks security-role-ref as declared in portlet.xml.  Also including new test portlet page for testing security info like this.
  
  Revision  Changes    Path
  1.5       +1 -1      jakarta-pluto/testsuite/src/webapp/jsp/test9.jsp
  
  Index: test9.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/testsuite/src/webapp/jsp/test9.jsp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- test9.jsp	8 Jul 2004 11:25:49 -0000	1.4
  +++ test9.jsp	30 Jul 2004 18:45:46 -0000	1.5
  @@ -44,7 +44,7 @@
   <P>
   
   <portlet:renderURL windowState="Normal" portletMode="View" secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
  -	<portlet:param name="jspName" value="test1.jsp"/>
  +	<portlet:param name="jspName" value="test10.jsp"/>
   </portlet:renderURL>
   
   <FORM METHOD="POST" ACTION="<%=url%>">
  
  
  
  1.1                  jakarta-pluto/testsuite/src/webapp/jsp/test10.jsp
  
  Index: test10.jsp
  ===================================================================
  <!--
  Copyright 2004 The Apache Software Foundation
  Licensed  under the  Apache License,  Version 2.0  (the "License");
  you may not use  this file  except in  compliance with the License.
  You may obtain a copy of the License at
  
  http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed  under the  License is distributed on an "AS IS" BASIS,
  WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
  implied.
  
  See the License for the specific language governing permissions and
  limitations under the License.
  -->
  <%@ page session="false" %>
  <%@ taglib uri='http://java.sun.com/portlet' prefix='portlet'%>
  <%@ page import="javax.portlet.*"%>
  <%@ page import="java.util.*"%>
  <portlet:defineObjects/>
  
  <I>This portlet is testing security information:</I>
  
  <p>To test security information, you must first log in. When configuring
  your realm, ensure that the user is given the role 'tomcat'
  for accurate testing. </p>
  
  <%
      if(renderRequest.getRemoteUser()==null) {
  %>
  <p><b>You are not logged in</b></p>
  <% } else { %>
  
  <p>Remote User: <%= renderRequest.getRemoteUser() %></p>
  <p>Is User in 'fake' role: <%=renderRequest.isUserInRole("fake")?"<FONT color=\"red\">YES</FONT>":"No" %></p>
  <p>Is User in 'plutoTestRole' role: <%=!renderRequest.isUserInRole("plutoTestRole")?"<FONT color=\"red\">No</FONT>":"Yes" %></p>
  <p>Is User in 'tomcat' role: <%=!renderRequest.isUserInRole("tomcat")?"<FONT color=\"red\">No</FONT>":"Yes" %></p>
  
  <% } %>
  
  <portlet:renderURL windowState="Normal" portletMode="View" secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
  	<portlet:param name="jspName" value="test1.jsp"/>
  </portlet:renderURL>
  
  <FORM METHOD="POST" ACTION="<%=url%>">
  <INPUT value="Next >>" TYPE="submit">
  </FORM>