continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r420951 - in /maven/continuum/branches/continuum-acegi/continuum-webapp/src/main: resources/plexus-application.xml webapp/logoff.jsp webapp/navigations/DefaultTop.jsp webapp/navigations/Menu.jsp webapp/secure/debug.jsp
Date Tue, 11 Jul 2006 19:27:40 GMT
Author: carlos
Date: Tue Jul 11 12:27:40 2006
New Revision: 420951

URL: http://svn.apache.org/viewvc?rev=420951&view=rev
Log:
Integrate acegi with view

Modified:
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/plexus-application.xml
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/logoff.jsp
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/navigations/DefaultTop.jsp
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/navigations/Menu.jsp
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/secure/debug.jsp

Modified: maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/plexus-application.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/plexus-application.xml?rev=420951&r1=420950&r2=420951&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/plexus-application.xml
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/plexus-application.xml
Tue Jul 11 12:27:40 2006
@@ -279,8 +279,11 @@
     </component>
 
     <!--
-     | Acegi
+     | ACEGI Configuration
      -->
+     
+    <!-- Authentication -->
+
 <!--
     <component>
       <role>org.acegisecurity.util.FilterChainProxy</role>
@@ -392,7 +395,7 @@
       </requirements>
       <configuration>
         <authenticationFailureUrl>/login!default.action?login_error=1</authenticationFailureUrl>
-        <defaultTargetUrl>/</defaultTargetUrl>
+        <defaultTargetUrl>/summary.action</defaultTargetUrl>
         <filterProcessesUrl>/j_acegi_security_check</filterProcessesUrl>
       </configuration>
     </component>
@@ -406,6 +409,9 @@
       </configuration>
     </component>
 
+
+    <!-- authorization -->
+
     <component>
       <role>org.acegisecurity.vote.AffirmativeBased</role>
       <implementation>org.acegisecurity.vote.AffirmativeBased</implementation>
@@ -441,7 +447,24 @@
             <filterInvocationDefinitionSourceMapping>
               <url>/secure/**</url>
               <configAttributes>
-                <configAttribute>ROLE_USER</configAttribute>
+                <configAttribute>ROLE_ADMIN</configAttribute>
+              </configAttributes>
+            </filterInvocationDefinitionSourceMapping>
+            <filterInvocationDefinitionSourceMapping>
+              <url>/add*project*</url>
+              <configAttributes>
+                <configAttribute>ROLE_ADMIN</configAttribute>
+              </configAttributes>
+            </filterInvocationDefinitionSourceMapping>
+            <filterInvocationDefinitionSourceMapping>
+              <url>/schedules*</url>
+              <configAttributes>
+                <configAttribute>ROLE_ADMIN</configAttribute>
+              </configAttributes>
+            </filterInvocationDefinitionSourceMapping>
+            <filterInvocationDefinitionSourceMapping>
+              <url>/configuration*</url>
+              <configAttributes>
                 <configAttribute>ROLE_ADMIN</configAttribute>
               </configAttributes>
             </filterInvocationDefinitionSourceMapping>

Modified: maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/logoff.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/logoff.jsp?rev=420951&r1=420950&r2=420951&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/logoff.jsp (original)
+++ maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/logoff.jsp Tue
Jul 11 12:27:40 2006
@@ -5,5 +5,5 @@
 Cookie terminate = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY,
null);
 terminate.setMaxAge(0);
 response.addCookie(terminate);
-response.sendRedirect("index.jsp");
+response.sendRedirect("summary.action");
 %>

Modified: maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/navigations/DefaultTop.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/navigations/DefaultTop.jsp?rev=420951&r1=420950&r2=420951&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/navigations/DefaultTop.jsp
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/navigations/DefaultTop.jsp
Tue Jul 11 12:27:40 2006
@@ -1,5 +1,11 @@
 <%@ taglib uri="/webwork" prefix="ww" %>
 <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<%@ taglib uri="http://acegisecurity.org/authz" prefix="authz" %>
+
+<%-- Acegi configuration --%>
+<c:set var="authentication" value="${sessionScope['ACEGI_SECURITY_CONTEXT'].authentication}"/>
+<c:set var="user" value="${authentication.principal}" scope="session"/>
+
 
 <ww:i18n name="localization.Continuum">
 <div id="banner">
@@ -29,7 +35,17 @@
   </div>
 
   <div>
-      <b><font color="red">TODO</font></b>Welcome, <b>Guest</b>
- <a href="<ww:url value="login!default.action"/>">Login</a>
+      <b><font color="red">TODO</font></b>Welcome,
+
+      <c:if test="${not empty user}">
+        <b><authz:authentication operation="username"/></b> -
+        <a href="<c:url value='/logoff.jsp'/>">Logoff</a>
+      </c:if>
+
+      <c:if test="${empty user}">
+        <a href="<ww:url value="login!default.action"/>">Login</a>
+      </c:if>
+
   </div>
 </div>
 </ww:i18n>

Modified: maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/navigations/Menu.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/navigations/Menu.jsp?rev=420951&r1=420950&r2=420951&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/navigations/Menu.jsp
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/navigations/Menu.jsp
Tue Jul 11 12:27:40 2006
@@ -1,4 +1,6 @@
 <%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri="http://acegisecurity.org/authz" prefix="authz" %>
+
 <ww:i18n name="localization.Continuum">
 <div id="navcolum">
   <div id="projectmenu" class="toolgroup">
@@ -12,34 +14,41 @@
       </div>
     </div>
   </div>
-  <div id="projectmenu" class="toolgroup">
-    <div class="label"><ww:text name="menu.addProject"/></div>
-    <div>
-      <div class="body">
-        <a href="<ww:url value="addMavenTwoProject!default.action"/>"><ww:text
name="menu.add.m2Project"/></a>
-      </div>
-      <div class="body">
-        <a href="<ww:url value="addMavenOneProject!default.action"/>"><ww:text
name="menu.add.m1Project"/></a>
-      </div>
-      <div class="body">
-        <a href="<ww:url value="addProject!default.action"><ww:param name="projectType">ant</ww:param></ww:url>"><ww:text
name="menu.add.antProject"/></a>
-      </div>
-      <div class="body">
-        <a href="<ww:url value="addProject!default.action"><ww:param name="projectType">shell</ww:param></ww:url>"><ww:text
name="menu.add.shellProject"/></a>
+
+  <authz:authorize ifAllGranted="ROLE_ADMIN">
+    <div id="projectmenu" class="toolgroup">
+      <div class="label"><ww:text name="menu.addProject"/></div>
+      <div>
+        <div class="body">
+          <a href="<ww:url value="addMavenTwoProject!default.action"/>"><ww:text
name="menu.add.m2Project"/></a>
+        </div>
+        <div class="body">
+          <a href="<ww:url value="addMavenOneProject!default.action"/>"><ww:text
name="menu.add.m1Project"/></a>
+        </div>
+        <div class="body">
+          <a href="<ww:url value="addProject!default.action"><ww:param name="projectType">ant</ww:param></ww:url>"><ww:text
name="menu.add.antProject"/></a>
+        </div>
+        <div class="body">
+          <a href="<ww:url value="addProject!default.action"><ww:param name="projectType">shell</ww:param></ww:url>"><ww:text
name="menu.add.shellProject"/></a>
+        </div>
       </div>
     </div>
-  </div>
-  <div id="projectmenu" class="toolgroup">
-    <div class="label"><ww:text name="menu.administration"/></div>
-    <div>
-      <div class="body">
-        <a href="<ww:url value="schedules.action"/>"><ww:text name="menu.administration.schedules"/></a>
-      </div>
-      <div class="body">
-        <a href="<ww:url value="configuration!default.action"/>"><ww:text
name="menu.administration.configuration"/></a>
+  </authz:authorize>      
+
+  <authz:authorize ifAllGranted="ROLE_ADMIN">
+    <div id="projectmenu" class="toolgroup">
+      <div class="label"><ww:text name="menu.administration"/></div>
+      <div>
+        <div class="body">
+          <a href="<ww:url value="schedules.action"/>"><ww:text name="menu.administration.schedules"/></a>
+        </div>
+        <div class="body">
+          <a href="<ww:url value="configuration!default.action"/>"><ww:text
name="menu.administration.configuration"/></a>
+        </div>
       </div>
     </div>
-  </div>
+  </authz:authorize>      
+
   <div id="projectmenu" class="toolgroup">
     <div class="label">Legend</div>
     <div id="legend">

Modified: maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/secure/debug.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/secure/debug.jsp?rev=420951&r1=420950&r2=420951&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/secure/debug.jsp
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/secure/debug.jsp
Tue Jul 11 12:27:40 2006
@@ -1,4 +1,5 @@
 <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<%@ taglib uri="http://acegisecurity.org/authz" prefix="authz" %>
 
 <%@ page import="org.acegisecurity.context.SecurityContextHolder" %>
 <%@ page import="org.acegisecurity.Authentication" %>
@@ -29,11 +30,12 @@
 <%		}
 %>
 
+<hr/>
 
 <%-- other way to access the info using taglibs --%>
 
   <c:set var="authentication" value="${sessionScope['ACEGI_SECURITY_CONTEXT'].authentication}"/>
-  <c:set var="user" value="${authentication.principal}"/>
+  <c:set var="user" value="${authentication.principal}" scope="session"/>
 
   user: <c:out value="${user.username}"/><br/>
   Roles: 
@@ -42,3 +44,9 @@
         <li><c:out value="${item.authority}"/></li>
       </c:forEach>
     </ul>
+
+<hr/>
+
+<%-- Yet another way to access the info using Acegi taglib --%>
+
+  User: <authz:authentication operation="username"/>



Mime
View raw message