continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r295039 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-model/src/main/mdo/ continuum-web/src/main/java/org/apache/maven/continuum/web/a...
Date Wed, 05 Oct 2005 17:04:49 GMT
Author: evenisse
Date: Wed Oct  5 10:04:22 2005
New Revision: 295039

URL: http://svn.apache.org/viewcvs?rev=295039&view=rev
Log:
o Add user management screens
o Fix some stuff in user group management

[CONTINUUM-276] hook users and permissions into store configuration

Added:
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/Logout.java   (with props)
    maven/continuum/trunk/continuum-web/src/main/resources/forms/user.xml   (with props)
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUser.vm   (with props)
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUser.vm   (with props)
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUserGroup.vm   (with props)
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUser.vm   (with props)
Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo
    maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-web/src/main/resources/forms/userGroups.xml
    maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/DefaultTop.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddMavenProject.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUserGroup.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUserGroup.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Schedules.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/UserGroups.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Users.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/WorkingCopy.vm

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Wed Oct  5 10:04:22 2005
@@ -220,6 +220,17 @@
     // User
     // ----------------------------------------------------------------------
 
+    void addUser( ContinuumUser user );
+
+    void addUser( Map configuration )
+        throws ContinuumException;
+
+    void updateUser( ContinuumUser user )
+        throws ContinuumException;
+
+    void updateUser( int userId, Map configuration )
+        throws ContinuumException;
+
     List getUsers()
         throws ContinuumException;
 
@@ -236,6 +247,9 @@
     void addUserGroup( UserGroup userGroup );
 
     void addUserGroup( Map configuration )
+        throws ContinuumException;
+
+    void updateUserGroup( UserGroup userGroup )
         throws ContinuumException;
 
     void updateUserGroup( int userGroupId, Map configuration )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Wed Oct  5 10:04:22 2005
@@ -1091,6 +1091,24 @@
         store.addUser( user );
     }
 
+    public void addUser( Map configuration )
+        throws ContinuumException
+    {
+        ContinuumUser user = new ContinuumUser();
+
+        user.setUsername( (String) configuration.get( "user.username" ) );
+
+        user.setFullName( (String) configuration.get( "user.fullName" ) );
+
+        user.setPassword( (String) configuration.get( "user.password" ) );
+
+        user.setEmail( (String) configuration.get( "user.email" ) );
+
+        user.setGroup( getUserGroup( new Integer( (String) configuration.get( "user.group" ) ).intValue() ) );
+
+        addUser( user );
+    }
+
     public void updateUser( ContinuumUser user )
         throws ContinuumException
     {
@@ -1104,6 +1122,24 @@
         }
     }
 
+    public void updateUser( int userId, Map configuration )
+        throws ContinuumException
+    {
+        ContinuumUser user = getUser( userId );
+
+        user.setUsername( (String) configuration.get( "user.username" ) );
+
+        user.setFullName( (String) configuration.get( "user.fullName" ) );
+
+        user.setPassword( (String) configuration.get( "user.password" ) );
+
+        user.setEmail( (String) configuration.get( "user.email" ) );
+
+        user.setGroup( getUserGroup( new Integer( (String) configuration.get( "user.group" ) ).intValue() ) );
+
+        updateUser( user );
+    }
+
     public ContinuumUser getUser( int userId )
         throws ContinuumException
     {
@@ -1158,81 +1194,11 @@
 
             userGroup.setDescription( (String) configuration.get( "group.description" ) );
 
-            List perms = new ArrayList();
-
-            if ( convert( (String) configuration.get( "group.permission.addProject" ) ) )
-            {
-                perms.add( store.getPermission( "addProject" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.editProject" ) ) )
-            {
-                perms.add( store.getPermission( "editProject" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.deleteProject" ) ) )
-            {
-                perms.add( store.getPermission( "deleteProject" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.buildProject" ) ) )
-            {
-                perms.add( store.getPermission( "buildProject" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.showProject" ) ) )
-            {
-                perms.add( store.getPermission( "showProject" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.addBuildDefinition" ) ) )
-            {
-                perms.add( store.getPermission( "addBuildDefinition" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.editBuildDefinition" ) ) )
-            {
-                perms.add( store.getPermission( "editBuildDefinition" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.deleteBuildDefinition" ) ) )
-            {
-                perms.add( store.getPermission( "deleteBuildDefinition" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.addNotifier" ) ) )
-            {
-                perms.add( store.getPermission( "addNotifier" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.editNotifier" ) ) )
-            {
-                perms.add( store.getPermission( "editNotifier" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.deleteNotifier" ) ) )
-            {
-                perms.add( store.getPermission( "deleteNotifier" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.manageConfiguration" ) ) )
-            {
-                perms.add( store.getPermission( "manageConfiguration" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.manageSchedule" ) ) )
-            {
-                perms.add( store.getPermission( "manageSchedule" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.manageUsers" ) ) )
-            {
-                perms.add( store.getPermission( "manageUsers" ) );
-            }
+            List perms = parsePermissionConf( configuration );
 
             userGroup.setPermissions( perms );
 
-            store.addUserGroup( userGroup );
+            addUserGroup( userGroup );
         }
         catch ( ContinuumStoreException e )
         {
@@ -1251,85 +1217,106 @@
 
             userGroup.setDescription( (String) configuration.get( "group.description" ) );
 
-            List perms = new ArrayList();
-
-            if ( convert( (String) configuration.get( "group.permission.addProject" ) ) )
-            {
-                perms.add( store.getPermission( "addProject" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.editProject" ) ) )
-            {
-                perms.add( store.getPermission( "editProject" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.deleteProject" ) ) )
-            {
-                perms.add( store.getPermission( "deleteProject" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.buildProject" ) ) )
-            {
-                perms.add( store.getPermission( "buildProject" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.showProject" ) ) )
-            {
-                perms.add( store.getPermission( "showProject" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.addBuildDefinition" ) ) )
-            {
-                perms.add( store.getPermission( "addBuildDefinition" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.editBuildDefinition" ) ) )
-            {
-                perms.add( store.getPermission( "editBuildDefinition" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.deleteBuildDefinition" ) ) )
-            {
-                perms.add( store.getPermission( "deleteBuildDefinition" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.addNotifier" ) ) )
-            {
-                perms.add( store.getPermission( "addNotifier" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.editNotifier" ) ) )
-            {
-                perms.add( store.getPermission( "editNotifier" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.deleteNotifier" ) ) )
-            {
-                perms.add( store.getPermission( "deleteNotifier" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.manageConfiguration" ) ) )
-            {
-                perms.add( store.getPermission( "manageConfiguration" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.manageSchedule" ) ) )
-            {
-                perms.add( store.getPermission( "manageSchedule" ) );
-            }
-
-            if ( convert( (String) configuration.get( "group.permission.manageUsers" ) ) )
-            {
-                perms.add( store.getPermission( "manageUsers" ) );
-            }
+            List perms = parsePermissionConf( configuration );
 
             userGroup.setPermissions( perms );
 
-            store.updateUserGroup( userGroup );
+            updateUserGroup( userGroup );
         }
         catch ( ContinuumStoreException ex )
         {
             throw logAndCreateException( "Error while storing user group.", ex );
+        }
+    }
+
+    private List parsePermissionConf( Map configuration )
+        throws ContinuumStoreException
+    {
+        List perms = new ArrayList();
+
+        if ( convert( (String) configuration.get( "group.permission.addProject" ) ) )
+        {
+            perms.add( store.getPermission( "addProject" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.editProject" ) ) )
+        {
+            perms.add( store.getPermission( "editProject" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.deleteProject" ) ) )
+        {
+            perms.add( store.getPermission( "deleteProject" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.buildProject" ) ) )
+        {
+            perms.add( store.getPermission( "buildProject" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.showProject" ) ) )
+        {
+            perms.add( store.getPermission( "showProject" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.addBuildDefinition" ) ) )
+        {
+            perms.add( store.getPermission( "addBuildDefinition" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.editBuildDefinition" ) ) )
+        {
+            perms.add( store.getPermission( "editBuildDefinition" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.deleteBuildDefinition" ) ) )
+        {
+            perms.add( store.getPermission( "deleteBuildDefinition" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.addNotifier" ) ) )
+        {
+            perms.add( store.getPermission( "addNotifier" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.editNotifier" ) ) )
+        {
+            perms.add( store.getPermission( "editNotifier" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.deleteNotifier" ) ) )
+        {
+            perms.add( store.getPermission( "deleteNotifier" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.manageConfiguration" ) ) )
+        {
+            perms.add( store.getPermission( "manageConfiguration" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.manageSchedule" ) ) )
+        {
+            perms.add( store.getPermission( "manageSchedule" ) );
+        }
+
+        if ( convert( (String) configuration.get( "group.permission.manageUsers" ) ) )
+        {
+            perms.add( store.getPermission( "manageUsers" ) );
+        }
+
+        return perms;
+    }
+
+    public void updateUserGroup( UserGroup userGroup )
+        throws ContinuumException
+    {
+        try
+        {
+            store.updateUserGroup( userGroup );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw logAndCreateException( "Error while storing user group.", e );
         }
     }
 

Modified: maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo Wed Oct  5 10:04:22 2005
@@ -791,10 +791,16 @@
         <codeSegment>
           <version>1.0.0+</version>
           <code><![CDATA[
+            public String getPassword()
+            {
+                return "";
+            }
+
             public void setPassword( String password )
             {
                 setHashedPassword( crypt( password ) );
             }
+
             public boolean equalsPassword( String password )
             {
                 if ( hashedPassword == null && password == null )

Added: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/Logout.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/Logout.java?rev=295039&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/Logout.java (added)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/Logout.java Wed Oct  5 10:04:22 2005
@@ -0,0 +1,49 @@
+package org.apache.maven.continuum.web.action;
+
+/*
+ * Copyright 2004-2005 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.
+ */
+
+import org.apache.maven.continuum.model.system.ContinuumUser;
+import org.apache.maven.continuum.store.ContinuumStore;
+import org.apache.maven.continuum.web.model.SessionUser;
+import org.codehaus.plexus.security.summit.SecureRunData;
+import org.codehaus.plexus.action.AbstractAction;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class Logout
+    extends AbstractAction
+{
+    /**
+     * @plexus.requirement
+     */
+    private ContinuumStore store;
+
+    public void execute( Map map )
+        throws Exception
+    {
+        SecureRunData secData = (SecureRunData) map.get( "data" );
+
+        secData.setUser( null );
+
+        secData.setTarget( "Index.vm" );
+    }
+}

Propchange: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/Logout.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/Logout.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml Wed Oct  5 10:04:22 2005
@@ -316,7 +316,7 @@
           </view>
           <!--
            |
-           | Project Builds Definitions
+           | User Group
            |
            -->
           <view>
@@ -324,7 +324,21 @@
             <scalars>
               <scalar>
                 <id>userGroup</id>
-                <expression>getuserGroup(#id)</expression>
+                <expression>getUserGroup(#id)</expression>
+              </scalar>
+            </scalars>
+          </view>
+          <!--
+           |
+           | User
+           |
+           -->
+          <view>
+            <id>User</id>
+            <scalars>
+              <scalar>
+                <id>user</id>
+                <expression>getUser(#id)</expression>
               </scalar>
             </scalars>
           </view>
@@ -432,6 +446,12 @@
 
     <component>
       <role>org.codehaus.plexus.action.Action</role>
+      <role-hint>logout</role-hint>
+      <implementation>org.apache.maven.continuum.web.action.Logout</implementation>
+    </component>
+
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
       <role-hint>addMavenTwoProject</role-hint>
       <implementation>org.apache.maven.continuum.web.action.AddMavenTwoProject</implementation>
       <requirements>
@@ -517,6 +537,23 @@
           <call>
             <cid>updateUserGroup</cid>
             <expression>updateUserGroup(#id,#parameters)</expression>
+          </call>
+          <!--
+           |
+           | User
+           |
+           -->
+          <call>
+            <cid>addUser</cid>
+            <expression>addUser(#parameters)</expression>
+          </call>
+          <call>
+            <cid>deleteUser</cid>
+            <expression>removeUser(#id)</expression>
+          </call>
+          <call>
+            <cid>updateUser</cid>
+            <expression>updateUser(#id,#parameters)</expression>
           </call>
         </calls>
       </configuration>

Added: maven/continuum/trunk/continuum-web/src/main/resources/forms/user.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/user.xml?rev=295039&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/user.xml (added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/user.xml Wed Oct  5 10:04:22 2005
@@ -0,0 +1,90 @@
+<form>
+  <id>users</id>
+  <key-expression>id</key-expression>
+  <summary-collection-expression>getUsers()</summary-collection-expression>
+  <source-role>org.apache.maven.continuum.Continuum</source-role>
+  <target-class>org.apache.maven.continuum.model.system.ContinuumUser</target-class>
+  <lookup-expression>getUser(#id)</lookup-expression>
+  <elements>
+    <element>
+      <id>user.username</id>
+      <validators>
+        <validator>
+          <id>required</id>
+          <error-message-key>user.username.error</error-message-key>
+        </validator>
+      </validators>
+      <type>text</type>
+      <label-key>user.username.label</label-key>
+      <message-key>user.username.message</message-key>
+      <expression>username</expression>
+    </element>
+    <element>
+      <id>user.fullName</id>
+      <validators>
+        <validator>
+          <id>required</id>
+          <error-message-key>user.fullName.error</error-message-key>
+        </validator>
+      </validators>
+      <type>text</type>
+      <label-key>user.fullName.label</label-key>
+      <message-key>user.fullName.message</message-key>
+      <expression>fullName</expression>
+    </element>
+    <element>
+      <id>user.password</id>
+      <validators>
+        <validator>
+          <id>required</id>
+          <error-message-key>user.password.error</error-message-key>
+        </validator>
+      </validators>
+      <type>password</type>
+      <label-key>user.password.label</label-key>
+      <message-key>user.password.message</message-key>
+      <expression>password</expression>
+    </element>
+    <element>
+      <id>user.email</id>
+      <validators>
+        <validator>
+          <id>required</id>
+          <error-message-key>user.email.error</error-message-key>
+        </validator>
+      </validators>
+      <type>text</type>
+      <label-key>user.email.label</label-key>
+      <message-key>user.email.message</message-key>
+      <expression>email</expression>
+    </element>
+  </elements>
+
+  <!-- Add -->
+  <add>
+    <title-key>user.addTitle</title-key>
+    <action>addEntity</action>
+    <view>Users.vm</view>
+    <view-on-failure>AddUser.vm</view-on-failure>
+    <fid-on-failure>users</fid-on-failure>
+    <expression>addUser(#entity)</expression>
+  </add>
+
+  <!-- Update -->
+  <update>
+    <title-key>user.updateTitle</title-key>
+    <action>updateEntity</action>
+    <view>Users.vm</view>
+    <view-on-failure>EditUser.vm</view-on-failure>
+    <fid-on-failure>users</fid-on-failure>
+    <expression>updateUser(#entity)</expression>
+  </update>
+
+  <!-- Delete -->
+  <delete>
+    <title-key>user.deleteTitle</title-key>
+    <view>Users.vm</view>
+    <action>deleteEntity</action>
+    <expression>removeUser(#id)</expression>
+  </delete>
+</form>

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/forms/user.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/forms/user.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/userGroups.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/userGroups.xml?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/userGroups.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/userGroups.xml Wed Oct  5 10:04:22 2005
@@ -51,7 +51,7 @@
     <view>UserGroups.vm</view>
     <view-on-failure>Edit.vm</view-on-failure>
     <fid-on-failure>userGroups</fid-on-failure>
-    <expression>updateUserGroups(#entity)</expression>
+    <expression>updateUserGroup(#entity)</expression>
   </update>
 
   <!-- Delete -->

Modified: maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties Wed Oct  5 10:04:22 2005
@@ -252,7 +252,9 @@
 group.deleteTitle = Delete User Group
 group.deleteConfirmationMessage = Are you sure you want to delete this user group?
 
-group.name.label = Name
+group.management.label = Group Management
+
+group.name.label = Group Name
 group.name.message = Enter the name of the user group
 group.name.error = You must enter a name for the user group
 
@@ -261,30 +263,78 @@
 group.description.error = You must enter a description for the user group
 
 group.permission.addProject.label = Add Projects
+group.permission.addProject.message = Check it if user can add Projects
 
 group.permission.editProject.label = Edit Projects
+group.permission.editProject.message = Check it if user can edit Projects
 
 group.permission.deleteProject.label = Delete Projects
+group.permission.deleteProject.message = Check it if user can delete Projects
 
 group.permission.buildProject.label = Build Projects
+group.permission.buildProject.message = Check it if user can build Projects
 
 group.permission.showProject.label = Show Projects
+group.permission.showProject.message = Check it if user can show Projects
 
 group.permission.addBuildDefinition.label = Add Build Definitions
+group.permission.addBuildDefinition.message = Check it if user can add Build Definitions
 
 group.permission.editBuildDefinition.label = Edit Build Definitions
+group.permission.editBuildDefinition.message = Check it if user can edit Build Definitions
 
 group.permission.deleteBuildDefinition.label = Delete Build Definitions
+group.permission.deleteBuildDefinition.message = Check it if user can delete Build Definitions
 
 group.permission.addNotifier.label = Add Notifiers
+group.permission.addNotifier.message = Check it if user can add Notifiers
 
 group.permission.editNotifier.label = Edit Notifiers
+group.permission.editNotifier.message = Check it if user can edit Notifiers
 
 group.permission.deleteNotifier.label = Delete Notifiers
+group.permission.deleteNotifier.message = Check it if user can delete Notifiers
 
 group.permission.manageConfiguration.label = Manage Continuum Configuration
+group.permission.manageConfiguration.message = Check it if user can manage Continuum Configuration
 
 group.permission.manageSchedule.label = Manage Schedules
+group.permission.manageSchedule.message = Check it if user can manage Schedules
 
 group.permission.manageUsers.label = Manage Users/Group
+group.permission.manageUsers.message = Check it if user can manage Users/Group
+
+// ----------------------------------------------------------------------
+// User
+// ----------------------------------------------------------------------
+
+user.addTitle = Add User
+user.updateTitle = Edit User
+user.deleteTitle = Delete User
+
+user.deleteConfirmationMessage = Are you sure you want to delete this user?
+
+user.group.label = Group Name
+
+user.username.label = Username
+user.username.message = The user login
+user.username.error = Username is required
+
+user.fullName.label = Full Name
+user.fullName.message = The full user name
+user.fullName.error = Full Name is required
+
+user.password.label = Password
+user.password.message = The user password
+user.password.error = Password is required
+
+user.passwordNew.label = Re-enter Password
+user.passwordNew.message = The user password
+user.passwordNew.error = Password is required
+
+user.email.label = Email
+user.email.message = The user email
+user.email.error = Email is required
 
+user.groupName.label = Group Name
+user.groupName.message = The user group

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/DefaultTop.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/DefaultTop.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/DefaultTop.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/DefaultTop.vm Wed Oct  5 10:04:22 2005
@@ -36,7 +36,7 @@
 
   <div>
     #if ( $data.getUser() )
-      Welcome, <b>$data.user.fullName</b>
+      Welcome, <b>$data.user.fullName</b> - <a href="$link?action=logout">Disconnect</a>
     #else
       Welcome, <b>Guest</b> - <a href="$link.setPage('Login.vm')">Login</a>
     #end

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm Wed Oct  5 10:04:22 2005
@@ -1,14 +1,23 @@
+#if ( $data.user )
+  #set ( $c1user = $continuum.getUser( $data.user.userId ) )
+#else
+  #set ( $c1user = $continuum.security.getGuestUser() )
+#end
+
 <div id="navcolum">
   <div id="projectmenu" class="toolgroup">
     <div class="label">Continuum</div>
 
+    #if ( $continuum.security.isAuthorized( $c1user, "showProject" ) )
     <div class="body">
       <div>
         <a href="$link.setPage('Summary.vm').addPathInfo( 'fid', 'continuumProject')">Show Projects</a>
       </div>
     </div>
+    #end
   </div>
 
+  #if ( $continuum.security.isAuthorized( $c1user, "addProject" ) )
   <div id="projecttools" class="toolgroup">
     <div class="label">Add Project</div>
 
@@ -27,6 +36,7 @@
       </div>
     </div>
   </div>
+  #end
 
   <!--
   <div id="projecttools" class="toolgroup">
@@ -38,13 +48,17 @@
   </div>
   -->
 
-  #if ( $data.user )
+  #if ( $continuum.security.isAuthorized( $c1user, "manageSchedule" ) || $continuum.security.isAuthorized( $c1user, "manageUsers" ) )
   <div id="projecttools" class="toolgroup">
    <div class="label">Administration</div>
    <div class="body">
+     #if ( $continuum.security.isAuthorized( $c1user, "manageSchedule" ) )
      <div><a href="$link.setPage('Schedules.vm').addPathInfo( 'fid', 'schedules')">Schedules</a></div>
+     #end
+     #if ( $continuum.security.isAuthorized( $c1user, "manageUsers" ) )
      <div><a href="$link.setPage('UserGroups.vm')">User Groups Management</a></div>
      <div><a href="$link.setPage('Users.vm')">Users Management</a></div>
+     #end
    </div>
   </div>
   #end

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Add.vm Wed Oct  5 10:04:22 2005
@@ -7,7 +7,9 @@
       #hidden ( "fid" $form.id )
       #hidden ( "action" $form.add.action )
       #hidden ( "view" $form.add.view )
+      #if ( $id )
       #hidden ( "id" $id )
+      #end
       <div class="axial">
         <table border="1" cellspacing="2" cellpadding="3" width="100%">
           #foreach ( $element in $form.elements )

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddMavenProject.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddMavenProject.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddMavenProject.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddMavenProject.vm Wed Oct  5 10:04:22 2005
@@ -7,7 +7,6 @@
       #hidden ( "fid" $form.id )
       #hidden ( "action" $form.add.action )
       #hidden ( "view" $form.add.view )
-      #hidden ( "id" $id )
 
       <div class="axial">
         <table border="1" cellspacing="2" cellpadding="3" width="100%">

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUser.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUser.vm?rev=295039&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUser.vm (added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUser.vm Wed Oct  5 10:04:22 2005
@@ -0,0 +1,39 @@
+$page.setTitle( $i18n.getString( $form.add.titleKey ) )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>$i18n.getString( $form.add.titleKey )</h3>
+    <form method="post" action="$link" #if( $form.attributes.multipart )enctype="multipart/form-data"#end>
+      #hidden ( "action" "cam" )
+      #hidden ( "cid" "addUser" )
+      #hidden ( "view" "$form.add.view" )
+      #hidden ( "id" $id )
+      <div class="axial">
+        <table border="1" cellspacing="2" cellpadding="3" width="100%">
+          #foreach ( $element in $form.elements )
+            #if ( !$element.immutable )
+            <tr>
+              #field( $i18n $data $element $item $formtool )
+            </tr>
+            #else
+              #if ( $element.defaultValue )
+                #hidden ( $element.id $element.defaultValue )
+              #end
+            #end
+          #end
+          <tr>
+            <th>$i18n.getString( "user.groupName.label" )</th>
+            <td>
+              <select name="user.group">
+                #foreach ( $group in $continuum.getUserGroups() )
+                  <option value="$group.id">$group.name</option>
+                #end
+              </select>
+            </td>
+          </tr>
+        </table>
+        #submitBar( "Submit" )
+      </div>
+    </form>
+  </div>
+</div>

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUser.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUser.vm
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUserGroup.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUserGroup.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUserGroup.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddUserGroup.vm Wed Oct  5 10:04:22 2005
@@ -7,7 +7,6 @@
       #hidden ( "action" "cam" )
       #hidden ( "cid" "addUserGroup" )
       #hidden ( "view" "$form.add.view" )
-      #hidden ( "id" $id )
       <div class="axial">
         <table border="1" cellspacing="2" cellpadding="3" width="100%">
           #foreach ( $element in $form.elements )
@@ -22,128 +21,128 @@
             #end
           #end
         <tr>
-          <th>Add Projects</th>
+          <th>$i18n.getString( "group.permission.addProject.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.addProject" />
             <p>
-              group.permission.addProject.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.addProject.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Edit Projects</th>
+          <th>$i18n.getString( "group.permission.editProject.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.editProject" />
             <p>
-              group.permission.editProject.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.editProject.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Delete Projects</th>
+          <th>$i18n.getString( "group.permission.deleteProject.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.deleteProject" />
             <p>
-              group.permission.deleteProject.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.deleteProject.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Build Projects</th>
+          <th>$i18n.getString( "group.permission.buildProject.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.buildProject" />
             <p>
-              group.permission.buildProject.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.buildProject.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Show Projects</th>
+          <th>$i18n.getString( "group.permission.showProject.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.showProject" />
             <p>
-              group.permission.showProject.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.showProject.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Add Build Definitions</th>
+          <th>$i18n.getString( "group.permission.addBuildDefinition.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.addBuildDefinition" />
             <p>
-              group.permission.addBuildDefinition.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.addBuildDefinition.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Edit Build Definitions</th>
+          <th>$i18n.getString( "group.permission.editBuildDefinition.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.editBuildDefinition" />
             <p>
-              group.permission.editBuildDefinition.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.editBuildDefinition.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Delete Build Definitions</th>
+          <th>$i18n.getString( "group.permission.deleteBuildDefinition.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.deleteBuildDefinition" />
             <p>
-              group.permission.deleteBuildDefinition.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.deleteBuildDefinition.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Add Notifiers</th>
+          <th>$i18n.getString( "group.permission.addNotifier.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.addNotifier" />
             <p>
-              group.permission.addNotifier.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.addNotifier.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Edit Notifiers</th>
+          <th>$i18n.getString( "group.permission.editNotifier.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.editNotifier" />
             <p>
-              group.permission.editNotifier.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.editNotifier.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Delete Notifiers</th>
+          <th>$i18n.getString( "group.permission.deleteNotifier.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.deleteNotifier" />
             <p>
-              group.permission.deleteNotifier.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.deleteNotifier.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Manage Continuum Configuration</th>
+          <th>$i18n.getString( "group.permission.manageConfiguration.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.manageConfiguration" />
             <p>
-              group.permission.manageConfiguration.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.manageConfiguration.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Manage Schedules</th>
+          <th>$i18n.getString( "group.permission.manageSchedule.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.manageSchedule" />
             <p>
-              group.permission.manageSchedule.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.manageSchedule.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Manage Users/Group</th>
+          <th>$i18n.getString( "group.permission.manageUsers.label" )</th>
           <td >
             <input type="checkbox" name="group.permission.manageUsers" />
             <p>
-              group.permission.manageUsers.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.manageUsers.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUser.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUser.vm?rev=295039&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUser.vm (added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUser.vm Wed Oct  5 10:04:22 2005
@@ -0,0 +1,22 @@
+$page.setTitle( $i18n.getString( $form.delete.titleKey ) )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>$i18n.getString( $form.delete.titleKey )</h3>
+    <div class="warningmessage">
+      <p>
+        <strong>$i18n.getString( "user.deleteConfirmationMessage" )</strong>
+      </p>
+    </div>
+    <form method="post" action="$link">
+      #hidden ( "fid" $form.id )
+      #hidden ( "action" $form.delete.action )
+      #hidden ( "view" $form.delete.view )
+      #hidden ( "id" $id )
+      <div class="functnbar3">
+        <input type="submit" name="deleteEntry" value="Delete"/>
+        <input type="submit" name="cancel" value="Cancel"/>
+      </div>
+  </form>
+  </div>
+</div>

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUser.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUser.vm
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUserGroup.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUserGroup.vm?rev=295039&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUserGroup.vm (added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUserGroup.vm Wed Oct  5 10:04:22 2005
@@ -0,0 +1,22 @@
+$page.setTitle( $i18n.getString( $form.delete.titleKey ) )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>$i18n.getString( $form.delete.titleKey )</h3>
+    <div class="warningmessage">
+      <p>
+        <strong>$i18n.getString( "group.deleteConfirmationMessage" )</strong>
+      </p>
+    </div>
+    <form method="post" action="$link">
+      #hidden ( "fid" $form.id )
+      #hidden ( "action" $form.delete.action )
+      #hidden ( "view" $form.delete.view )
+      #hidden ( "id" $id )
+      <div class="functnbar3">
+        <input type="submit" name="deleteEntry" value="Delete"/>
+        <input type="submit" name="cancel" value="Cancel"/>
+      </div>
+  </form>
+  </div>
+</div>

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUserGroup.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/DeleteUserGroup.vm
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUser.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUser.vm?rev=295039&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUser.vm (added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUser.vm Wed Oct  5 10:04:22 2005
@@ -0,0 +1,35 @@
+$page.setTitle( $i18n.getString( $form.update.titleKey ) )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>$i18n.getString( $form.update.titleKey )</h3>
+    <form method="post" action="$link">
+      #hidden ( "action" "cam" )
+      #hidden ( "cid" "updateUser" )
+      #hidden ( "view" "$form.update.view" )
+      #hidden ( "id" $item.accountId )
+      <div class="axial">
+        <table border="1" cellspacing="2" cellpadding="3" width="100%">
+          #foreach ( $element in $form.elements )
+          #if ( !$element.immutable )
+          <tr>
+            #field( $i18n $data $element $item $formtool )
+          </tr>
+          #end
+          #end
+          <tr>
+            <th>$i18n.getString( "user.groupName.label" )</th>
+            <td>
+              <select name="user.group">
+                #foreach ( $group in $continuum.getUserGroups() )
+                  <option value="$group.id" #if ( $group.id == $item.group.id ) selected="selected" #end>$group.name</option>
+                #end
+              </select>
+            </td>
+          </tr>
+        </table>
+        #submitBar( "Submit" )
+      </div>
+    </form>
+  </div>
+</div>

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUser.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUser.vm
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUserGroup.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUserGroup.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUserGroup.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/EditUserGroup.vm Wed Oct  5 10:04:22 2005
@@ -1,8 +1,8 @@
-$page.setTitle( $i18n.getString( $form.add.titleKey ) )
+$page.setTitle( $i18n.getString( $form.update.titleKey ) )
 
 <div class="app">
   <div id="axial" class="h3">
-    <h3>$i18n.getString( $form.add.titleKey )</h3>
+    <h3>$i18n.getString( $form.update.titleKey )</h3>
     <form method="post" action="$link" #if( $form.attributes.multipart )enctype="multipart/form-data"#end>
       #hidden ( "action" "cam" )
       #hidden ( "cid" "updateUserGroup" )
@@ -22,128 +22,128 @@
             #end
           #end
         <tr>
-          <th>Add Projects</th>
+          <th>$i18n.getString( "group.permission.addProject.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.addProject" />
+            <input type="checkbox" name="group.permission.addProject" #if ( $continuum.security.isAuthorized( $item, "addProject" ) ) checked="checked" #end/>
             <p>
-              group.permission.addProject.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.addProject.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Edit Projects</th>
+          <th>$i18n.getString( "group.permission.editProject.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.editProject" />
+            <input type="checkbox" name="group.permission.editProject"  #if ( $continuum.security.isAuthorized( $item, "editProject" ) ) checked="checked" #end/>
             <p>
-              group.permission.editProject.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.editProject.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Delete Projects</th>
+          <th>$i18n.getString( "group.permission.deleteProject.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.deleteProject" />
+            <input type="checkbox" name="group.permission.deleteProject"  #if ( $continuum.security.isAuthorized( $item, "deleteProject" ) ) checked="checked" #end/>
             <p>
-              group.permission.deleteProject.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.deleteProject.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Build Projects</th>
+          <th>$i18n.getString( "group.permission.buildProject.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.buildProject" />
+            <input type="checkbox" name="group.permission.buildProject"  #if ( $continuum.security.isAuthorized( $item, "buildProject" ) ) checked="checked" #end/>
             <p>
-              group.permission.buildProject.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.buildProject.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Show Projects</th>
+          <th>$i18n.getString( "group.permission.showProject.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.showProject" />
+            <input type="checkbox" name="group.permission.showProject"  #if ( $continuum.security.isAuthorized( $item, "showProject" ) ) checked="checked" #end/>
             <p>
-              group.permission.showProject.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.showProject.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Add Build Definitions</th>
+          <th>$i18n.getString( "group.permission.addBuildDefinition.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.addBuildDefinition" />
+            <input type="checkbox" name="group.permission.addBuildDefinition"  #if ( $continuum.security.isAuthorized( $item, "addBuildDefinition" ) ) checked="checked" #end/>
             <p>
-              group.permission.addBuildDefinition.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.addBuildDefinition.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Edit Build Definitions</th>
+          <th>$i18n.getString( "group.permission.editBuildDefinition.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.editBuildDefinition" />
+            <input type="checkbox" name="group.permission.editBuildDefinition"  #if ( $continuum.security.isAuthorized( $item, "editBuildDefinition" ) ) checked="checked" #end/>
             <p>
-              group.permission.editBuildDefinition.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.editBuildDefinition.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Delete Build Definitions</th>
+          <th>$i18n.getString( "group.permission.deleteBuildDefinition.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.deleteBuildDefinition" />
+            <input type="checkbox" name="group.permission.deleteBuildDefinition"  #if ( $continuum.security.isAuthorized( $item, "deleteBuildDefinition" ) ) checked="checked" #end/>
             <p>
-              group.permission.deleteBuildDefinition.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.deleteBuildDefinition.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Add Notifiers</th>
+          <th>$i18n.getString( "group.permission.addNotifier.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.addNotifier" />
+            <input type="checkbox" name="group.permission.addNotifier"  #if ( $continuum.security.isAuthorized( $item, "addNotifier" ) ) checked="checked" #end/>
             <p>
-              group.permission.addNotifier.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.addNotifier.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Edit Notifiers</th>
+          <th>$i18n.getString( "group.permission.editNotifier.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.editNotifier" />
+            <input type="checkbox" name="group.permission.editNotifier"  #if ( $continuum.security.isAuthorized( $item, "editNotifier" ) ) checked="checked" #end/>
             <p>
-              group.permission.editNotifier.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.editNotifier.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Delete Notifiers</th>
+          <th>$i18n.getString( "group.permission.deleteNotifier.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.deleteNotifier" />
+            <input type="checkbox" name="group.permission.deleteNotifier"  #if ( $continuum.security.isAuthorized( $item, "deleteNotifier" ) ) checked="checked" #end/>
             <p>
-              group.permission.deleteNotifier.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.deleteNotifier.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Manage Continuum Configuration</th>
+          <th>$i18n.getString( "group.permission.manageConfiguration.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.manageConfiguration" />
+            <input type="checkbox" name="group.permission.manageConfiguration"  #if ( $continuum.security.isAuthorized( $item, "manageConfiguration" ) ) checked="checked" #end/>
             <p>
-              group.permission.manageConfiguration.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.manageConfiguration.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Manage Schedules</th>
+          <th>$i18n.getString( "group.permission.manageSchedule.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.manageSchedule" />
+            <input type="checkbox" name="group.permission.manageSchedule"  #if ( $continuum.security.isAuthorized( $item, "manageSchedule" ) ) checked="checked" #end/>
             <p>
-              group.permission.manageSchedule.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.manageSchedule.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>
         <tr>
-          <th>Manage Users/Group</th>
+          <th>$i18n.getString( "group.permission.manageUsers.label" )</th>
           <td >
-            <input type="checkbox" name="group.permission.manageUsers" />
+            <input type="checkbox" name="group.permission.manageUsers"  #if ( $continuum.security.isAuthorized( $item, "manageUsers" ) ) checked="checked" #end/>
             <p>
-              group.permission.manageUsers.message <font color="red"><b></b></font>
+              $i18n.getString( "group.permission.manageUsers.message" ) <font color="red"><b></b></font>
             </p>
           </td>
         </tr>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuild.vm Wed Oct  5 10:04:22 2005
@@ -1,7 +1,14 @@
 $page.setTitle( "Continuum - ${project.name} Build at $date.format('medium',$build.startTime)" )
 
+#if ( $data.user )
+  #set ( $c1user = $continuum.getUser( $data.user.userId ) )
+#else
+  #set ( $c1user = $continuum.security.getGuestUser() )
+#end
+
 <div class="app">
 
+  #if ( $continuum.security.isAuthorized( $c1user, "showProject" ) )
   <div>
     <p style="border-top: 1px solid transparent; border-bottom: 1px solid black;">
       #set ( $infoLink = $link.setPage('View.vm').addPathInfo('fid', "$!{project.executorId}Project").addPathInfo('id', $project.id) )
@@ -11,6 +18,7 @@
       <a style="border: 1px solid black; padding-left: 1em; padding-right: 1em; text-decoration:none;" href="$workingCopy">Working&nbsp;Copy</a>
     </p>
   </div>
+  #end
 
   <h3>Build result for $project.name</h3>
   <p>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm Wed Oct  5 10:04:22 2005
@@ -1,7 +1,14 @@
 $page.setTitle( "Continuum - ${project.name} Builds" )
 
+#if ( $data.user )
+  #set ( $c1user = $continuum.getUser( $data.user.userId ) )
+#else
+  #set ( $c1user = $continuum.security.getGuestUser() )
+#end
+
 <div class="app">
 
+  #if ( $continuum.security.isAuthorized( $c1user, "showProject" ) )
   <div>
     <p style="border-top: 1px solid transparent; border-bottom: 1px solid black;">
       #set ( $infoLink = $link.setPage('View.vm').addPathInfo('fid', "$!{project.executorId}Project").addPathInfo('id', $project.id) )
@@ -11,6 +18,7 @@
       <a style="border: 1px solid black; padding-left: 1em; padding-right: 1em; text-decoration:none;" href="$workingCopy">Working&nbsp;Copy</a>
     </p>
   </div>
+  #end
 
   <h3>Build results for $project.name</h3>
   <p>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Schedules.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Schedules.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Schedules.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Schedules.vm Wed Oct  5 10:04:22 2005
@@ -1,5 +1,11 @@
 $page.setTitle( "Continuum" )
 
+#if ( $data.user )
+  #set ( $c1user = $continuum.getUser( $data.user.userId ) )
+#else
+  #set ( $c1user = $continuum.security.getGuestUser() )
+#end
+
 #set ( $items = $continuum.schedules )
 
 <div class="app">
@@ -23,13 +29,16 @@
           <td>$schedule.cronExpression</td>
           <td>$schedule.delay</td>
           <td width="10%">
-            #if ( $schedule.name != "DEFAULT_SCHEDULE" )
-              <a href="$link.setPage('Edit.vm').addPathInfo( 'fid', 'schedules').addPathInfo('id', $schedule.id)">Edit</a>
-              | <a href="$link.setPage('Delete.vm').addPathInfo('fid', "schedules").addPathInfo('id', $schedule.id)">Delete</a></td>
+            #if ( $continuum.security.isAuthorized( $c1user, "manageSchedule" ) )
+              #if ( $schedule.name != "DEFAULT_SCHEDULE" )
+                <a href="$link.setPage('Edit.vm').addPathInfo( 'fid', 'schedules').addPathInfo('id', $schedule.id)">Edit</a>
+                | <a href="$link.setPage('Delete.vm').addPathInfo('fid', "schedules").addPathInfo('id', $schedule.id)">Delete</a></td>
+              #end
             #end
         </tr>
       #end
     </table>
+    #if ( $continuum.security.isAuthorized( $c1user, "manageSchedule" ) )
     <div class="functnbar3">
       <table>
         <tr>
@@ -41,6 +50,7 @@
         </tr>
       </table>
     </div>
+    #end
   </div>
 </div>
 

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Summary.vm Wed Oct  5 10:04:22 2005
@@ -9,6 +9,12 @@
 
 $page.setTitle( "Continuum" )
 
+#if ( $data.user )
+  #set ( $c1user = $continuum.getUser( $data.user.userId ) )
+#else
+  #set ( $c1user = $continuum.security.getGuestUser() )
+#end
+
 #set( $success = 0 )
 #set( $failures = 0 )
 #set( $errors = 0 )
@@ -60,10 +66,12 @@
 
         ## Operations
 
-        #if ( $item.state == 1 || $item.state == 2 || $item.state == 3 || $item.state == 4 )
-        <td><a href="$link.addPathInfo('action', 'cam').addPathInfo('cid','buildProject').addPathInfo('id', $item.id)">Build&nbsp;Now</a></td>
-        #else
-        <td>Build</td>
+        #if ( $continuum.security.isAuthorized( $c1user, "buildProject" ) )
+          #if ( $item.state == 1 || $item.state == 2 || $item.state == 3 || $item.state == 4 )
+          <td><a href="$link.addPathInfo('action', 'cam').addPathInfo('cid','buildProject').addPathInfo('id', $item.id)">Build&nbsp;Now</a></td>
+          #else
+          <td>Build</td>
+          #end
         #end
 
         #if ( $item.latestBuildId > 0 )
@@ -73,13 +81,15 @@
         #end
 
         #if ( $item.state == 1 || $item.state == 2 || $item.state == 3 || $item.state == 4 )
-        <!-- td>Working&nbsp;Copy</td -->
+        <td><a href="$link.setPage('WorkingCopy.vm').addPathInfo('view', "WorkingCopy").addPathInfo('id', $item.id)">Working&nbsp;Copy</a></td>
         #end
 
-        #if ( $item.state == 1 || $item.state == 2 || $item.state == 3 || $item.state == 4 )
-        <td><a href="$link.setPage('Delete.vm').addPathInfo('fid', "$!{item.executorId}Project").addPathInfo('id', $item.id)">Delete</a></td>
-        #else
-        <td>Delete</td>
+        #if ( $continuum.security.isAuthorized( $c1user, "deleteProject" ) )
+          #if ( $item.state == 1 || $item.state == 2 || $item.state == 3 || $item.state == 4 )
+          <td><a href="$link.setPage('Delete.vm').addPathInfo('fid', "$!{item.executorId}Project").addPathInfo('id', $item.id)">Delete</a></td>
+          #else
+          <td>Delete</td>
+          #end
         #end
 
       </tr>
@@ -87,6 +97,7 @@
       </tbody>
     </table>
 
+    #if ( $continuum.security.isAuthorized( $c1user, "buildProject" ) )
     <div class="functnbar3">
       <form method="post" action="$link">
         <img src="/continuum/images/icon_success_sml.gif" alt="Success"/> $success
@@ -100,6 +111,7 @@
         #end
       </form>
     </div>
+    #end
   </div>
 </div>
 

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/UserGroups.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/UserGroups.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/UserGroups.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/UserGroups.vm Wed Oct  5 10:04:22 2005
@@ -1,27 +1,33 @@
-$page.setTitle( "Continuum - Group Management" )
+$page.setTitle( $i18n.getString( "group.management.label" ) )
+
+#if ( $data.user )
+  #set ( $c1user = $continuum.getUser( $data.user.userId ) )
+#else
+  #set ( $c1user = $continuum.security.getGuestUser() )
+#end
 
 #set ( $items = $continuum.userGroups )
 
 <div class="app">
   <div id="h3">
-    <h3>Group Management</h3>
+    <h3>$i18n.getString( "group.management.label" )</h3>
     <table border="1" cellspacing="2" cellpadding="3" width="100%">
       <tr>
-        <th width="10%">Name</th>
-        <th>Add Projects</th>
-        <th>Edit Projects</th>
-        <th>Delete Projects</th>
-        <th>Build Projects</th>
-        <th>Show Projects</th>
-        <th>Add Build Definitions</th>
-        <th>Edit Build Definitions</th>
-        <th>Delete Build Definitions</th>
-        <th>Add Notifiers</th>
-        <th>Edit Notifiers</th>
-        <th>Delete Notifiers</th>
-        <th>Manage Continuum Configuration</th>
-        <th>Manage Schedules</th>
-        <th>Manage Users/Groups</th>
+        <th width="10%">$i18n.getString( "group.name.label" )</th>
+        <th>$i18n.getString( "group.permission.addProject.label" )</th>
+        <th>$i18n.getString( "group.permission.editProject.label" )</th>
+        <th>$i18n.getString( "group.permission.deleteProject.label" )</th>
+        <th>$i18n.getString( "group.permission.buildProject.label" )</th>
+        <th>$i18n.getString( "group.permission.showProject.label" )</th>
+        <th>$i18n.getString( "group.permission.addBuildDefinition.label" )</th>
+        <th>$i18n.getString( "group.permission.editBuildDefinition.label" )</th>
+        <th>$i18n.getString( "group.permission.deleteBuildDefinition.label" )</th>
+        <th>$i18n.getString( "group.permission.addNotifier.label" )</th>
+        <th>$i18n.getString( "group.permission.editNotifier.label" )</th>
+        <th>$i18n.getString( "group.permission.deleteNotifier.label" )</th>
+        <th>$i18n.getString( "group.permission.manageConfiguration.label" )</th>
+        <th>$i18n.getString( "group.permission.manageSchedule.label" )</th>
+        <th>$i18n.getString( "group.permission.manageUsers.label" )</th>
         <th width="10%">&nbsp;</th>
       </tr>
       #foreach ( $group in $items )
@@ -126,12 +132,15 @@
           #end
         </td>
         <td>
+          #if ( $continuum.security.isAuthorized( $c1user, "manageUsers" ) )
           <a href="$link.setPage('EditUserGroup.vm').addPathInfo( 'fid', 'userGroups').addPathInfo('id', $group.id)">Edit</a>
-          | <a href="$link.setPage('Delete.vm').addPathInfo('fid', "userGroups").addPathInfo('id', $group.id)">Delete</a></td>
+          | <a href="$link.setPage('DeleteUserGroup.vm').addPathInfo('fid', "userGroups").addPathInfo('id', $group.id)">Delete</a></td>
+          #end
         </td>
       </tr>
       #end
     </table>
+    #if ( $continuum.security.isAuthorized( $c1user, "manageUsers" ) )
     <div class="functnbar3">
       <table>
         <tr>
@@ -143,6 +152,7 @@
         </tr>
       </table>
     </div>
+    #end
   </div>
 </div>
 

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Users.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Users.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Users.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/Users.vm Wed Oct  5 10:04:22 2005
@@ -1,5 +1,11 @@
 $page.setTitle( "Continuum - User Management" )
 
+#if ( $data.user )
+  #set ( $c1user = $continuum.getUser( $data.user.userId ) )
+#else
+  #set ( $c1user = $continuum.security.getGuestUser() )
+#end
+
 #set ( $items = $continuum.users )
 
 <div class="app">
@@ -7,10 +13,10 @@
     <h3>User Management</h3>
     <table border="1" cellspacing="2" cellpadding="3" width="100%">
       <tr>
-        <th width="10%">Username</th>
-        <th width="10%">Full Name</th>
-        <th width="10%">Email</th>
-        <th width="10%">Group</th>
+        <th width="10%">$i18n.getString( "user.username.label" )</th>
+        <th width="10%">$i18n.getString( "user.fullName.label" )</th>
+        <th width="10%">$i18n.getString( "user.email.label" )</th>
+        <th width="10%">$i18n.getString( "user.groupName.label" )</th>
         <th width="10%">&nbsp;</th>
       </tr>
       #foreach ( $user in $items )
@@ -19,23 +25,30 @@
         <td>$user.fullName</td>
         <td>#if ( $user.email ) $user.email #end</td>
         <td>$user.group.name</td>
-        <td></td>
+        <td>
+          #if ( $continuum.security.isAuthorized( $c1user, "manageUsers" ) )
+            #if ( "guest" != $user.username )
+            <a href="$link.setPage('EditUser.vm').addPathInfo( 'fid', 'users').addPathInfo('id', $user.accountId)">Edit</a>
+            | <a href="$link.setPage('DeleteUser.vm').addPathInfo('fid', "users").addPathInfo('id', $user.accountId)">Delete</a></td>
+            #end
+          #end
+        </td>
       </tr>
       #end
     </table>
-    <!--
+    #if ( $continuum.security.isAuthorized( $c1user, "manageUsers" ) )
     <div class="functnbar3">
       <table>
         <tr>
           <td>
-            <form method="post" action="$link.setPage('Add.vm').addPathInfo( 'fid', 'schedules')">
-              <input type="submit" name="add-build-def" value="Add"/>
+            <form method="post" action="$link.setPage('AddUser.vm').addPathInfo( 'fid', 'users')">
+              <input type="submit" name="add-user" value="Add"/>
             </form>
           </td>
         </tr>
       </table>
     </div>
-    -->
+    #end
   </div>
 </div>
 

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm Wed Oct  5 10:04:22 2005
@@ -1,7 +1,14 @@
 $page.setTitle( "Continuum - Project View: ${item.name}" )
 
+#if ( $data.user )
+  #set ( $c1user = $continuum.getUser( $data.user.userId ) )
+#else
+  #set ( $c1user = $continuum.security.getGuestUser() )
+#end
+
 <div class="app">
 
+  #if ( $continuum.security.isAuthorized( $c1user, "showProject" ) )
   <div>
     <p style="border-top: 1px solid transparent; border-bottom: 1px solid black;">
       <b style="border: 1px solid black; padding-left: 1em; padding-right: 1em;">Info</b>
@@ -11,6 +18,7 @@
       <a style="border: 1px solid black; padding-left: 1em; padding-right: 1em; text-decoration:none;" href="$workingCopy">Working&nbsp;Copy</a>
     </p>
   </div>
+  #end
 
   <div id="axial" class="h3">
     <h3>$i18n.getString( $form.view.titleKey )</h3>
@@ -34,6 +42,7 @@
           <td>$item.projectGroup.name</td>
         </tr>
       </table>
+      #if ( $continuum.security.isAuthorized( $c1user, "editProject" ) )
       <div class="functnbar3">
         <table>
           <tr>
@@ -45,6 +54,7 @@
           </tr>
         </table>
       </div>
+      #end
     </div>
 
     
@@ -80,14 +90,19 @@
         </td>
         <td>Project</td>
         <td>
+          #if ( $continuum.security.isAuthorized( $c1user, "editBuildDefinition" ) )
           #set ( $buildDefinitionLink = $link.setPage('BuildDefinition.vm').addPathInfo('view','BuildDefinition').addPathInfo('buildDefinitionId', $buildDefinition.id).addPathInfo('id', $item.id) )
           <a href="$buildDefinitionLink">Edit</a> |
+          #end
+          #if ( $continuum.security.isAuthorized( $c1user, "deleteBuildDefinition" ) )
           #set ( $deleteBuildDefinitionLink = $link.setPage('DeleteBuildDefinition.vm').addPathInfo('buildDefinitionId', $buildDefinition.id).addPathInfo('id', $item.id) )
           <a href="$deleteBuildDefinitionLink">Delete</a>
+          #end
         </td>
       </tr>
       #end
     </table>
+    #if ( $continuum.security.isAuthorized( $c1user, "addBuildDefinition" ) )
     <div class="functnbar3">
       <table>
         <tr>
@@ -99,6 +114,7 @@
         </tr>
       </table>
     </div>
+    #end
     
     #if ( $project.notifiers )
     <h3>$i18n.getString( "project.notifiers.label" )</h3>
@@ -141,26 +157,31 @@
           </td>
           <td>
             #if ( $notifier.isFromUser() )
-              #if ( $notifier.type == "irc" )
-                #set ( $editNotifierLink = $link.setPage('EditIrcNotifier.vm').addPathInfo('view','EditIrcNotifier').addPathInfo('notifierId', $notifier.id).addPathInfo('id', $item.id) )
-                <a href="$editNotifierLink">Edit</a>
-              #elseif ( $notifier.type == "mail" )
-                #set ( $editNotifierLink = $link.setPage('EditMailNotifier.vm').addPathInfo('view','EditMailNotifier').addPathInfo('notifierId', $notifier.id).addPathInfo('id', $item.id) )
-                <a href="$editNotifierLink">Edit</a>
-              #elseif ( $notifier.type == "msn" )
-                #set ( $editNotifierLink = $link.setPage('EditMsnNotifier.vm').addPathInfo('view','EditMsnNotifier').addPathInfo('notifierId', $notifier.id).addPathInfo('id', $item.id) )
-                <a href="$editNotifierLink">Edit</a>
-              #elseif ( $notifier.type == "jabber" )
-                #set ( $editNotifierLink = $link.setPage('EditJabberNotifier.vm').addPathInfo('view','EditJabberNotifier').addPathInfo('notifierId', $notifier.id).addPathInfo('id', $item.id) )
-                <a href="$editNotifierLink">Edit</a>
+              #if ( $continuum.security.isAuthorized( $c1user, "editNotifier" ) )
+                #if ( $notifier.type == "irc" )
+                  #set ( $editNotifierLink = $link.setPage('EditIrcNotifier.vm').addPathInfo('view','EditIrcNotifier').addPathInfo('notifierId', $notifier.id).addPathInfo('id', $item.id) )
+                  <a href="$editNotifierLink">Edit</a>
+                #elseif ( $notifier.type == "mail" )
+                  #set ( $editNotifierLink = $link.setPage('EditMailNotifier.vm').addPathInfo('view','EditMailNotifier').addPathInfo('notifierId', $notifier.id).addPathInfo('id', $item.id) )
+                  <a href="$editNotifierLink">Edit</a>
+                #elseif ( $notifier.type == "msn" )
+                  #set ( $editNotifierLink = $link.setPage('EditMsnNotifier.vm').addPathInfo('view','EditMsnNotifier').addPathInfo('notifierId', $notifier.id).addPathInfo('id', $item.id) )
+                  <a href="$editNotifierLink">Edit</a>
+                #elseif ( $notifier.type == "jabber" )
+                  #set ( $editNotifierLink = $link.setPage('EditJabberNotifier.vm').addPathInfo('view','EditJabberNotifier').addPathInfo('notifierId', $notifier.id).addPathInfo('id', $item.id) )
+                  <a href="$editNotifierLink">Edit</a>
+                #end
               #end
-              #set ( $deleteNotifierLink = $link.setPage('DeleteNotifier.vm').addPathInfo('notifierId', $notifier.id).addPathInfo('id', $item.id) )
+              #if ( $continuum.security.isAuthorized( $c1user, "deleteNotifier" ) )
+                #set ( $deleteNotifierLink = $link.setPage('DeleteNotifier.vm').addPathInfo('notifierId', $notifier.id).addPathInfo('id', $item.id) )
               | <a href="$deleteNotifierLink">Delete</a>
+              #end
             #end
           </td>
         </tr>
       #end
     </table>
+    #if ( $continuum.security.isAuthorized( $c1user, "addNotifier" ) )
     <div class="functnbar3">
       <table>
         <tr>
@@ -172,6 +193,7 @@
         </tr>
       </table>
     </div>
+    #end
     #end
 
     #if ( $project.dependencies )

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/WorkingCopy.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/WorkingCopy.vm?rev=295039&r1=295038&r2=295039&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/WorkingCopy.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/WorkingCopy.vm Wed Oct  5 10:04:22 2005
@@ -1,7 +1,14 @@
 $page.setTitle( "Continuum - Working Copy of ${project.name}" )
 
+#if ( $data.user )
+  #set ( $c1user = $continuum.getUser( $data.user.userId ) )
+#else
+  #set ( $c1user = $continuum.security.getGuestUser() )
+#end
+
 <div class="app">
 
+  #if ( $continuum.security.isAuthorized( $c1user, "showProject" ) )
   <div>
     <p style="border-top: 1px solid transparent; border-bottom: 1px solid black;">
       #set ( $infoLink = $link.setPage('View.vm').addPathInfo('fid', "$!{project.executorId}Project").addPathInfo('id', $project.id) )
@@ -11,6 +18,7 @@
       <b style="border: 1px solid black; padding-left: 1em; padding-right: 1em;">Working&nbsp;Copy</b>
     </p>
   </div>
+  #end
 
   <h3>Working Copy of $project.name</h3>
   <!-- <p><a href="#">Delete Working Copy</a></p> -->



Mime
View raw message