continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcconn...@apache.org
Subject svn commit: r453039 - in /maven/continuum/branches/rbac-integration/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ java/org/apache/maven/continuum/web/view/ resources/META-INF/plexus/ webapp/ webapp/components/
Date Wed, 04 Oct 2006 21:32:08 GMT
Author: jmcconnell
Date: Wed Oct  4 14:32:07 2006
New Revision: 453039

URL: http://svn.apache.org/viewvc?view=rev&rev=453039
Log:
finished wrapping up the assorted logic in authz tags

Modified:
    maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
    maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
    maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildNowCell.java
    maven/continuum/branches/rbac-integration/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
    maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/buildDefinitionGroupSummaryComponent.jsp
    maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/buildDefinitionSummaryComponent.jsp
    maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/projectSummaryComponent.jsp
    maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectGroupMembers.jsp
    maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectGroupSummary.jsp
    maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectView.jsp
    maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/summary.jsp

Modified: maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java?view=diff&rev=453039&r1=453038&r2=453039
==============================================================================
--- maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
(original)
+++ maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
Wed Oct  4 14:32:07 2006
@@ -38,6 +38,8 @@
 {
     private int projectGroupId;
 
+    private String projectGroupName;
+
     private int nbSuccesses;
 
     private int nbFailures;
@@ -155,5 +157,16 @@
     public void setProjectGroupId( int projectGroupId )
     {
         this.projectGroupId = projectGroupId;
+    }
+
+
+    public String getProjectGroupName()
+    {
+        return projectGroupName;
+    }
+
+    public void setProjectGroupName( String projectGroupName )
+    {
+        this.projectGroupName = projectGroupName;
     }
 }

Modified: maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java?view=diff&rev=453039&r1=453038&r2=453039
==============================================================================
--- maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
(original)
+++ maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildCell.java
Wed Oct  4 14:32:07 2006
@@ -17,7 +17,15 @@
  */
 
 import com.opensymphony.webwork.views.util.UrlHelper;
+import com.opensymphony.xwork.ActionContext;
 import org.apache.maven.continuum.web.model.ProjectSummary;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.security.authorization.AuthorizationException;
+import org.codehaus.plexus.security.system.SecuritySession;
+import org.codehaus.plexus.security.system.SecuritySystem;
+import org.codehaus.plexus.security.system.SecuritySystemConstants;
+import org.codehaus.plexus.xwork.PlexusLifecycleListener;
 import org.extremecomponents.table.bean.Column;
 import org.extremecomponents.table.cell.DisplayCell;
 import org.extremecomponents.table.core.TableModel;
@@ -39,13 +47,53 @@
     protected String getCellValue( TableModel tableModel, Column column )
     {
         ProjectSummary project = (ProjectSummary) tableModel.getCurrentRowBean();
-
         String contextPath = tableModel.getContext().getContextPath();
 
         int buildNumber = project.getBuildNumber();
 
         String result = "<div align=\"center\">";
 
+
+        // do the authz bit
+        ActionContext context = ActionContext.getContext();
+
+        PlexusContainer container = (PlexusContainer) context.getApplication().get( PlexusLifecycleListener.KEY
);
+        SecuritySession securitySession =
+            (SecuritySession) context.getSession().get( SecuritySystemConstants.SECURITY_SESSION_KEY
);
+
+        try
+        {
+            SecuritySystem securitySystem = (SecuritySystem) container.lookup( SecuritySystem.ROLE
);
+
+            if ( !securitySystem.isAuthorized( securitySession, "continuum-build-group",
+                                               project.getProjectGroupName() ) )
+            {
+                result += "<img src=\"" + contextPath +
+                    "/images/buildnow_disabled.gif\" alt=\"not authorized\" title=\"not authorized\"
border=\"0\">";
+                result += "</div>";
+
+                return result;
+            }
+        }
+        catch ( ComponentLookupException cle )
+        {
+            result +=
+                "<img src=\"" + contextPath + "/images/buildnow_disabled.gif\" alt=\"cle\"
title=\"cle\" border=\"0\">";
+            result += "</div>";
+
+            return result;
+        }
+        catch ( AuthorizationException ae )
+        {
+            result += "<img src=\"" + contextPath +
+                "/images/buildnow_disabled.gif\" alt=\"authz exception\" title=\"authz exception\"
border=\"0\">";
+            result += "</div>";
+
+            return result;
+        }
+
+
+        // we are authzd so act normally
         if ( project.isInQueue() )
         {
             result += "<img src=\"" + contextPath + "/images/inqueue.gif\" alt=\"In Queue\"
title=\"In Queue\" border=\"0\">";

Modified: maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildNowCell.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildNowCell.java?view=diff&rev=453039&r1=453038&r2=453039
==============================================================================
--- maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildNowCell.java
(original)
+++ maven/continuum/branches/rbac-integration/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/BuildNowCell.java
Wed Oct  4 14:32:07 2006
@@ -21,6 +21,14 @@
 import org.extremecomponents.table.bean.Column;
 import org.extremecomponents.table.cell.DisplayCell;
 import org.extremecomponents.table.core.TableModel;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.security.system.SecuritySession;
+import org.codehaus.plexus.security.system.SecuritySystemConstants;
+import org.codehaus.plexus.security.system.SecuritySystem;
+import org.codehaus.plexus.security.authorization.AuthorizationException;
+import org.codehaus.plexus.xwork.PlexusLifecycleListener;
+import com.opensymphony.xwork.ActionContext;
 
 /**
  * Used in Summary view
@@ -36,6 +44,33 @@
         ProjectSummary project = (ProjectSummary) tableModel.getCurrentRowBean();
 
         String contextPath = tableModel.getContext().getContextPath();
+
+        // do the authz bit
+        ActionContext context = ActionContext.getContext();
+
+        PlexusContainer container = (PlexusContainer) context.getApplication().get( PlexusLifecycleListener.KEY
);
+        SecuritySession securitySession =
+            (SecuritySession) context.getSession().get( SecuritySystemConstants.SECURITY_SESSION_KEY
);
+
+        try
+        {
+            SecuritySystem securitySystem = (SecuritySystem) container.lookup( SecuritySystem.ROLE
);
+
+            if ( !securitySystem.isAuthorized( securitySession, "continuum-build-group",
+                                               project.getProjectGroupName() ) )
+            {
+                return image( contextPath, "Not Authorized", "buildnow_disabled.gif" );
+            }
+        }
+        catch ( ComponentLookupException cle )
+        {
+            return image( contextPath, "Not Authorized[cle]", "buildnow_disabled.gif" );
+        }
+        catch ( AuthorizationException ae )
+        {
+            return image( contextPath, "Not Authorized[ae]", "buildnow_disabled.gif" );
+        }
+
 
         if ( project.isInQueue() )
         {

Modified: maven/continuum/branches/rbac-integration/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/rbac-integration/continuum-webapp/src/main/resources/META-INF/plexus/application.xml?view=diff&rev=453039&r1=453038&r2=453039
==============================================================================
--- maven/continuum/branches/rbac-integration/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
(original)
+++ maven/continuum/branches/rbac-integration/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
Wed Oct  4 14:32:07 2006
@@ -613,7 +613,7 @@
       <implementation>org.codehaus.plexus.security.policy.DefaultUserValidationSettings</implementation>
       <description>DefaultUserValidationSettings</description>
       <configuration>
-        <email-validation-required>true</email-validation-required>
+        <email-validation-required>false</email-validation-required>
         <!-- This is a timeout for the validation url (in minutes) - 2880 = 48 hours -->
         <email-validation-timeout>2880</email-validation-timeout>
         <email-login-path>/security/login!login.action</email-login-path>

Modified: maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/buildDefinitionGroupSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/buildDefinitionGroupSummaryComponent.jsp?view=diff&rev=453039&r1=453038&r2=453039
==============================================================================
--- maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/buildDefinitionGroupSummaryComponent.jsp
(original)
+++ maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/buildDefinitionGroupSummaryComponent.jsp
Wed Oct  4 14:32:07 2006
@@ -23,15 +23,21 @@
       <ec:column property="from" title="projectView.buildDefinition.from"/>
       <ec:column property="isDefault" title="projectView.buildDefinition.default"/>
       <ec:column property="editActions" title="Edit">
+        <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
           <ww:url id="editUrl" action="buildDefinition" method="input" namespace="/">
             <ww:param name="projectGroupId">${pageScope.buildDefinitionSummary.projectGroupId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
           </ww:url>
           <ww:a href="%{editUrl}">
               <img src="<ww:url value='/images/edit.gif'/>" alt="Edit" title="Edit"
border="0">
-          </ww:a>        
+          </ww:a>
+        </pss:ifAuthorized>
+        <pss:elseAuthorized>
+          <img src="<ww:url value='/images/edit_disabled.gif'/>" alt="Edit" title="Edit"
border="0">
+        </pss:elseAuthorized>
       </ec:column>    
-      <ec:column property="deleteActions" title="Remove">                
+      <ec:column property="deleteActions" title="Remove">
+        <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
           <ww:url id="removeUrl" action="removeGroupBuildDefinition" namespace="/">
             <ww:param name="projectGroupId">${pageScope.buildDefinitionSummary.projectGroupId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
@@ -40,14 +46,20 @@
         <ww:a href="%{removeUrl}">
             <img src="<ww:url value='/images/delete.gif'/>" alt="Delete" title="Delete"
border="0">
         </ww:a>
+        </pss:ifAuthorized>
+        <pss:elseAuthorized>
+          <img src="<ww:url value='/images/delete_disabled.gif'/>" alt="Delete"
title="Delete" border="0">
+        </pss:elseAuthorized>
       </ec:column>
     </ec:row>
   </ec:table>
   <div class="functnbar3">
+    <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
     <ww:form action="buildDefinition" method="post">
       <input type="hidden" name="projectGroupId" value="<ww:property value="projectGroupid"/>"/>
       <ww:submit value="%{getText('add')}"/>
     </ww:form>
+    </pss:ifAuthorized>
   </div>
 
   <h3>Project Build Definitions</h3>
@@ -69,23 +81,33 @@
       <ec:column property="from" title="projectView.buildDefinition.from"/>
       <ec:column property="isDefault" title="projectView.buildDefinition.default"/>
       <ec:column property="editAction" title="&nbsp;">
+        <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
           <ww:url id="editUrl" action="buildDefinition" method="input" namespace="/">
             <ww:param name="projectId">${pageScope.buildDefinitionSummary.projectId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
           </ww:url>
           <ww:a href="%{editUrl}">
               <img src="<ww:url value='/images/edit.gif'/>" alt="Edit" title="Edit"
border="0">          
-          </ww:a>          
-      </ec:column>    
-      <ec:column property="removeAction" title="&nbsp;">          
+          </ww:a>
+        </pss:ifAuthorized>
+        <pss:elseAuthorized>
+          <img src="<ww:url value='/images/edit_disabled.gif'/>" alt="Edit" title="Edit"
border="0">
+        </pss:elseAuthorized>
+      </ec:column>
+      <ec:column property="removeAction" title="&nbsp;">
+        <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
           <ww:url id="removeUrl" action="removeProjectBuildDefinition" namespace="/">
             <ww:param name="projectId">${pageScope.buildDefinitionSummary.projectId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
             <ww:param name="confirmed" value="false"/>
           </ww:url>
           <ww:a href="%{removeUrl}">
-              <img src="<ww:url value='/images/edit.gif'/>" alt="Edit" title="Edit"
border="0">          
+              <img src="<ww:url value='/images/delete.gif'/>" alt="Edit" title="Edit"
border="0">
           </ww:a>
+        </pss:ifAuthorized>
+        <pss:elseAuthorized>
+           <img src="<ww:url value='/images/delete_disabled.gif'/>" alt="Edit" title="Edit"
border="0"> 
+        </pss:elseAuthorized>
       </ec:column>
     </ec:row>
   </ec:table>

Modified: maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/buildDefinitionSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/buildDefinitionSummaryComponent.jsp?view=diff&rev=453039&r1=453038&r2=453039
==============================================================================
--- maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/buildDefinitionSummaryComponent.jsp
(original)
+++ maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/buildDefinitionSummaryComponent.jsp
Wed Oct  4 14:32:07 2006
@@ -1,6 +1,6 @@
 <%@ taglib uri="/webwork" prefix="ww" %>
 <%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>
-<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
 <%@ taglib uri="continuum" prefix="c1" %>
 <%@ taglib uri="/plexusSecuritySystem" prefix="pss" %>
 

Modified: maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/projectSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/projectSummaryComponent.jsp?view=diff&rev=453039&r1=453038&r2=453039
==============================================================================
--- maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/projectSummaryComponent.jsp
(original)
+++ maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/components/projectSummaryComponent.jsp
Wed Oct  4 14:32:07 2006
@@ -2,6 +2,8 @@
 <%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>
 <%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
 <%@ taglib uri="continuum" prefix="c1" %>
+<%@ taglib uri="/plexusSecuritySystem" prefix="pss" %>
+
 <ww:i18n name="localization.Continuum">
   <ec:table items="projects"
             var="project"
@@ -20,10 +22,11 @@
       <ec:column property="version" title="summary.projectTable.version" width="13%"/>
       <ec:column property="buildNumber" title="summary.projectTable.build" width="5%"
                  cell="org.apache.maven.continuum.web.view.BuildCell"/>
-      <ec:column property="projectGroupName" title="summary.projectTable.group" width="13%"/>
+      <ec:column property="projectGroupName" title="summary.projectTable.group" width="13%"/>

       <ec:column property="buildNowAction" title="&nbsp;" width="1%"
                  cell="org.apache.maven.continuum.web.view.BuildNowCell" sortable="false"/>
       <ec:column property="buildHistoryAction" title="&nbsp;" width="1%" sortable="false">
+        <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
         <c:choose>
           <c:when test="${pageScope.project.latestBuildId > 0}">
             <ww:url id="buildResultsUrl" action="buildResults" namespace="/">
@@ -38,8 +41,14 @@
                  border="0">
           </c:otherwise>
         </c:choose>
+        </pss:ifAuthorized>
+        <pss:elseAuthorized>
+          <img src="<ww:url value='/images/buildhistory_disabled.gif'/>" alt="Build
History" title="Build History"
+                 border="0">
+        </pss:elseAuthorized>
       </ec:column>
       <ec:column property="workingCopyAction" title="&nbsp;" width="1%" sortable="false">
+        <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
         <c:choose>
           <c:when
               test="${pageScope.project.state == 10 || pageScope.project.state == 2 || pageScope.project.state
== 3 || pageScope.project.state == 4 || pageScope.project.state == 6}">
@@ -54,8 +63,14 @@
                  border="0">
           </c:otherwise>
         </c:choose>
+        </pss:ifAuthorized>
+        <pss:elseAuthorized>
+          <img src="<ww:url value='/images/workingcopy_disabled.gif'/>" alt="Working
Copy" title="Working Copy"
+                 border="0">
+        </pss:elseAuthorized>
       </ec:column>
       <ec:column property="releaseAction" title="&nbsp;" width="1%" sortable="false">
+        <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
         <c:choose>
           <c:when test="${pageScope.project.state == 2}">
             <ww:url id="releaseProjectUrl" action="releaseProject!promptReleaseGoal.action"
namespace="/">
@@ -71,8 +86,13 @@
               title="Release Project" border="0"/>
           </c:otherwise>
         </c:choose>
+        </pss:ifAuthorized>
+        <pss:elseAuthorized>
+          <img src="<ww:url value='/images/delete_disabled.gif'/>" alt="Delete"
title="Delete" border="0">
+        </pss:elseAuthorized>
       </ec:column>
       <ec:column property="deleteAction" title="&nbsp;" width="1%" sortable="false">
+        <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
         <c:choose>
           <c:when
               test="${pageScope.project.state == 1 || pageScope.project.state == 10 || pageScope.project.state
== 2 || pageScope.project.state == 3 || pageScope.project.state == 4}">
@@ -88,6 +108,10 @@
             <img src="<ww:url value='/images/delete_disabled.gif'/>" alt="Delete"
title="Delete" border="0">
           </c:otherwise>
         </c:choose>
+        </pss:ifAuthorized>
+        <pss:elseAuthorized>
+          <img src="<ww:url value='/images/delete_disabled.gif'/>" alt="Delete"
title="Delete" border="0">
+        </pss:elseAuthorized>
       </ec:column>
     </ec:row>
   </ec:table>

Modified: maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectGroupMembers.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectGroupMembers.jsp?view=diff&rev=453039&r1=453038&r2=453039
==============================================================================
--- maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectGroupMembers.jsp
(original)
+++ maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectGroupMembers.jsp
Wed Oct  4 14:32:07 2006
@@ -2,6 +2,8 @@
 <%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>
 <%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
 <%@ taglib uri="continuum" prefix="c1" %>
+<%@ taglib uri="/plexusSecuritySystem" prefix="pss" %>
+
 <html>
 <ww:i18n name="localization.Continuum">
   <head>
@@ -27,7 +29,9 @@
     <h3>Membership Actions</h3>
 
     <div class="axial">
-      Scan for new Projects? 
+      <!--
+      Scan for new Projects?
+      -->
     </div>
 
     <h3>Member Projects</h3>
@@ -47,6 +51,7 @@
         </ec:column>
         <ec:column property="editAction" title="Edit" width="1%" sortable="false">
           <center>
+            <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroup.name}">
             <c:choose>
               <c:when
                   test="${pageScope.project.state == 1 || pageScope.project.state == 10 ||
pageScope.project.state == 2 || pageScope.project.state == 3 || pageScope.project.state ==
4}">
@@ -62,10 +67,15 @@
                 <img src="<ww:url value='/images/edit_disabled.gif'/>" alt="Edit"
title="Edit" border="0">
               </c:otherwise>
             </c:choose>
+            </pss:ifAuthorized>
+            <pss:elseAuthorized>
+                <img src="<ww:url value='/images/edit_disabled.gif'/>" alt="Edit"
title="Edit" border="0">
+            </pss:elseAuthorized>
           </center>
         </ec:column>
         <ec:column property="deleteAction" title="Remove" width="1%" sortable="false">
           <center>
+            <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroup.name}">
             <c:choose>
               <c:when
                   test="${pageScope.project.state == 1 || pageScope.project.state == 10 ||
pageScope.project.state == 2 || pageScope.project.state == 3 || pageScope.project.state ==
4}">
@@ -81,6 +91,10 @@
                 <img src="<ww:url value='/images/delete_disabled.gif'/>" alt="Delete"
title="Delete" border="0">
               </c:otherwise>
             </c:choose>
+            </pss:ifAuthorized>
+            <pss:elseAuthorized>
+                <img src="<ww:url value='/images/delete_disabled.gif'/>" alt="Delete"
title="Delete" border="0">
+            </pss:elseAuthorized>
           </center>
         </ec:column>
       </ec:row>

Modified: maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectGroupSummary.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectGroupSummary.jsp?view=diff&rev=453039&r1=453038&r2=453039
==============================================================================
--- maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectGroupSummary.jsp
(original)
+++ maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectGroupSummary.jsp
Wed Oct  4 14:32:07 2006
@@ -48,11 +48,10 @@
     </pss:ifAnyAuthorized>
 
     <h3>Projects</h3>
-
     <ww:action name="projectSummary" executeResult="true" namespace="component">
       <ww:param name="projectGroupId" value="%{projectGroupId}"/>
+      <ww:param name="projectGroupName" value="%{projectGroup.name}"/>
     </ww:action>
-
   </div>
   </body>
 </ww:i18n>

Modified: maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectView.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectView.jsp?view=diff&rev=453039&r1=453038&r2=453039
==============================================================================
--- maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectView.jsp
(original)
+++ maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/projectView.jsp
Wed Oct  4 14:32:07 2006
@@ -2,6 +2,8 @@
 <%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>
 <%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
 <%@ taglib uri="continuum" prefix="c1" %>
+<%@ taglib uri="/plexusSecuritySystem" prefix="pss" %>
+
 <html>
   <ww:i18n name="localization.Continuum">
     <head>
@@ -29,9 +31,7 @@
             </ww:url>            
             <c1:data label="%{getText('projectView.project.group')}" name="project.projectGroup.name"
valueLink="%{'${projectGroupSummaryUrl}'}"/>
           </table>
-          <!--
-            wrap this in security tag
-          -->
+          <pss:ifAuthorized permission="continuum-modify-group" resource="${project.projectGroup.name}">
           <div class="functnbar3">
             <table>
               <tbody>
@@ -52,6 +52,7 @@
               </tbody>
             </table>
           </div>
+          </pss:ifAuthorized>
         </div>
 
         <h3><ww:text name="projectView.buildDefinitions"/></h3>
@@ -61,10 +62,12 @@
         </ww:action>
 
         <div class="functnbar3">
+           <pss:ifAuthorized permission="continuum-modify-group" resource="${project.projectGroup.name}">
           <ww:form action="buildDefinition" method="post">
             <input type="hidden" name="projectId" value="<ww:property value="project.id"/>"/>
             <ww:submit value="%{getText('add')}"/>
           </ww:form>
+          </pss:ifAuthorized>
         </div>
 
         <h3><ww:text name="projectView.notifiers"/></h3>
@@ -82,6 +85,7 @@
             <ec:column property="events" title="projectView.notifier.events" cell="org.apache.maven.continuum.web.view.projectview.NotifierEventCell"/>
             <ec:column property="from" title="projectView.notifier.from" cell="org.apache.maven.continuum.web.view.projectview.NotifierFromCell"/>
             <ec:column property="actions" title="&nbsp;">
+               <pss:ifAuthorized permission="continuum-modify-group" resource="${project.projectGroup.name}">
                 <c:if test="${!pageScope.notifier.fromProject}">
                     <a href='<ww:url value="${notifier.type}NotifierEdit.action">
                       <ww:param name="projectId" value="project.id"/>
@@ -98,14 +102,17 @@
                       <img src="<ww:url value='/images/delete.gif'/>" alt="<ww:text
name='delete'/>" title="<ww:text name='delete'/>" border="0">
                     </a>
                 </c:if>
+              </pss:ifAuthorized>
             </ec:column>
           </ec:row>
         </ec:table>
         <div class="functnbar3">
+           <pss:ifAuthorized permission="continuum-modify-group" resource="${project.projectGroup.name}">
           <ww:form action="addNotifier!default.action" method="post">
             <input type="hidden" name="projectId" value="<ww:property value="project.id"/>"/>
             <ww:submit value="%{getText('add')}"/>
           </ww:form>
+          </pss:ifAuthorized>
         </div>
 
         <h3><ww:text name="projectView.dependencies"/></h3>

Modified: maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/summary.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/summary.jsp?view=diff&rev=453039&r1=453038&r2=453039
==============================================================================
--- maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/summary.jsp
(original)
+++ maven/continuum/branches/rbac-integration/continuum-webapp/src/main/webapp/summary.jsp
Wed Oct  4 14:32:07 2006
@@ -2,6 +2,8 @@
 <%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>
 <%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
 <%@ taglib uri="continuum" prefix="c1" %>
+<%@ taglib uri="/plexusSecuritySystem" prefix="pss" %>
+
 <html>
 <ww:i18n name="localization.Continuum">
   <head>
@@ -31,6 +33,7 @@
         <ec:column property="buildNowAction" title="&nbsp;" width="1%"
                    cell="org.apache.maven.continuum.web.view.BuildNowCell" sortable="false"/>
         <ec:column property="buildHistoryAction" title="&nbsp;" width="1%" sortable="false">
+          <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
           <c:choose>
             <c:when test="${pageScope.project.latestBuildId > 0}">
               <a href='<ww:url action="buildResults">
@@ -43,8 +46,14 @@
                    border="0">
             </c:otherwise>
           </c:choose>
+           </pss:ifAuthorized>
+          <pss:elseAuthorized>
+            <img src="<ww:url value='/images/buildhistory_disabled.gif'/>" alt="Build
History" title="Build History"
+                   border="0">
+          </pss:elseAuthorized>
         </ec:column>
         <ec:column property="workingCopyAction" title="&nbsp;" width="1%" sortable="false">
+          <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
           <c:choose>
             <c:when
                 test="${pageScope.project.state == 10 || pageScope.project.state == 2 ||
pageScope.project.state == 3 || pageScope.project.state == 4 || pageScope.project.state ==
6}">
@@ -58,10 +67,15 @@
                    border="0">
             </c:otherwise>
           </c:choose>
+          </pss:ifAuthorized>
+          <pss:elseAuthorized>
+            <img src="<ww:url value='/images/workingcopy_disabled.gif'/>" alt="Working
Copy" title="Working Copy"
+                   border="0">
+          </pss:elseAuthorized>
         </ec:column>
       </ec:row>
     </ec:table>
-    <c1:ifAuthorized permission="buildProject">
+    <pss:ifAuthorized permission="continuum-build-group" resource="${projectGroupName}">
       <div class="functnbar3">
         <ww:form action="buildProject.action" method="post">
           <ww:submit value="%{getText('summary.buildAll')}">
@@ -76,7 +90,7 @@
           </ww:submit>
         </ww:form>
       </div>
-    </c1:ifAuthorized>
+    </pss:ifAuthorized>
   </div>
   </body>
 </ww:i18n>



Mime
View raw message