]> source.dussan.org Git - archiva.git/commitdiff
new plexus-security snapshots with the authz mostly working minus some formatting...
authorJesse McConnell <jmcconnell@apache.org>
Tue, 19 Sep 2006 08:43:03 +0000 (08:43 +0000)
committerJesse McConnell <jmcconnell@apache.org>
Tue, 19 Sep 2006 08:43:03 +0000 (08:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@447780 13f79535-47bb-0310-9956-ffa450edef68

archiva-webapp/pom.xml
archiva-webapp/src/main/java/org/apache/maven/archiva/web/DefaultArchivaDefaults.java
archiva-webapp/src/main/java/org/apache/maven/archiva/web/interceptor/ConfigurationInterceptor.java
archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccess.java
archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/index.jsp
archiva-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp
archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp

index da1ca02f9db08c28a96f8081de4721c33fe3f824..8a51abed4115cccb090e212b9e8276d46e4a2792 100644 (file)
       <artifactId>plexus-security-ui-web-integration</artifactId>
       <version>1.0-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-ui-web-taglib</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
     <dependency>
       <groupId>org.codehaus.plexus.security</groupId>
       <artifactId>plexus-security-ui-web-rbac</artifactId>
index d45de4eb7bfa2b40acb91628716d2d92c93f945e..8f6f8a22aa74451d628e56a8d32864ac9d16dc67 100644 (file)
@@ -55,7 +55,7 @@ public class DefaultArchivaDefaults
      */
     private UserSecurityPolicy securityPolicy;
 
-    private boolean initialized;
+    private boolean initialized = false;
 
     private User guestUser;
 
index a164d2d57cf657a02455f44277341d6158453e0c..cb6cc4fe4a55bd3fd6e16028a217856afb9c38a4 100644 (file)
@@ -21,6 +21,7 @@ import com.opensymphony.xwork.interceptor.Interceptor;
 import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.configuration.ConfigurationStore;
 import org.apache.maven.archiva.web.util.RoleManager;
+import org.apache.maven.archiva.web.ArchivaDefaults;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.security.rbac.RBACManager;
 
@@ -49,6 +50,11 @@ public class ConfigurationInterceptor
      */
     private RBACManager rbacManager;
 
+    /**
+     * @plexus.requirement
+     */
+    private ArchivaDefaults archivaDefaults;
+
     /**
      *
      * @param actionInvocation
@@ -58,12 +64,9 @@ public class ConfigurationInterceptor
     public String intercept( ActionInvocation actionInvocation )
         throws Exception
     {
+        archivaDefaults.ensureDefaultsExist();
 
-//        if ( rbacManager.getAllUserAssignments().size() == 0 )
-//        {
-//            getLogger().info( "no accounts setup, create user account, forwarding to registration" );
-//            return "admin-account-needed";
-//        }
+        // determine if we need an admin account made
 
         Configuration configuration = configurationStore.getConfigurationFromStore();
 
index 6728528fd56f32cb23eafe1cca85db5b661be817..e7debf74f06405c1575e879a36b77661f5c88df0 100644 (file)
@@ -27,11 +27,11 @@ import org.apache.maven.archiva.web.servlet.AbstractPlexusServlet;
 import org.codehaus.plexus.security.authentication.AuthenticationException;
 import org.codehaus.plexus.security.authentication.AuthenticationResult;
 import org.codehaus.plexus.security.authorization.AuthorizationException;
-import org.codehaus.plexus.security.policy.AccountLockedException;
-import org.codehaus.plexus.security.policy.MustChangePasswordException;
 import org.codehaus.plexus.security.system.SecuritySession;
 import org.codehaus.plexus.security.system.SecuritySystem;
 import org.codehaus.plexus.security.ui.web.filter.authentication.HttpAuthenticator;
+import org.codehaus.plexus.security.policy.AccountLockedException;
+import org.codehaus.plexus.security.policy.MustChangePasswordException;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -161,12 +161,12 @@ public class RepositoryAccess
         }
         catch ( AccountLockedException e )
         {
-            httpAuth.challenge( request, response, "Repository " + repoconfig.getName(), 
+            httpAuth.challenge( request, response, "Repository " + repoconfig.getName(),
                                 new AuthenticationException("User account is locked") );
         }
         catch ( MustChangePasswordException e )
         {
-            httpAuth.challenge( request, response, "Repository " + repoconfig.getName(), 
+            httpAuth.challenge( request, response, "Repository " + repoconfig.getName(),
                                 new AuthenticationException("You must change your password before you can attempt this again.") );
         }
 
index 0ab09197384f08b8292b926aeeb1ea86f367b86a..8528918612b45dcb3813823b55f81a457247fa9e 100644 (file)
@@ -16,7 +16,7 @@
 
 <%@ taglib prefix="ww" uri="/webwork" %>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<%@ taglib prefix="pss" uri="plexusSecuritySystem" %>
+<%@ taglib prefix="pss" uri="/plexusSecuritySystem" %>
 
 <html>
 <head>
index 2c2395c04716a5d49b26616ae2916906cb1573be..02576ee2f0a474b4321bcee00dbc5fb28ba7d3e7 100644 (file)
@@ -16,7 +16,7 @@
 
 <%@ taglib prefix="ww" uri="/webwork" %>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<%@ taglib prefix="pss" uri="plexusSecuritySystem" %>
+<%@ taglib prefix="pss" uri="/plexusSecuritySystem" %>
 
 <html>
 <head>
index 0754b30c1369cf3881105a63b42a72df9cc9db61..702651fb9520aa0c7995a4c8e3a7f040f4b82b7d 100644 (file)
@@ -18,7 +18,7 @@
 <%@ taglib uri="/webwork" prefix="ww" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib prefix="my" tagdir="/WEB-INF/tags" %>
-<%@ taglib prefix="pss" uri="plexusSecuritySystem" %>
+<%@ taglib prefix="pss" uri="/plexusSecuritySystem" %>
 <html>
 <head>
   <title>Maven Archiva ::
                 </li>
           --%>
         <pss:ifAnyAuthorized permissions="edit-configuration,edit-all-users">
-          <li class="expanded">
-            <pss:ifAuthorized permission="edit-all-users">
-              <my:currentWWUrl action="userManagement!input" namespace="/admin">User Management</my:currentWWUrl>               
-            </pss:ifAuthorized>
-          </li>
-          <li>
-            <pss:ifAuthorized permission="edit-configuration">
+          <pss:ifAuthorized permission="edit-all-users">
+            <li class="none">
+              <my:currentWWUrl action="userlist" namespace="/security">User Management</my:currentWWUrl>
+            </li>
+          </pss:ifAuthorized>
+          <pss:ifAuthorized permission="edit-configuration">
+          <li class="none">
               <my:currentWWUrl action="index" namespace="/admin">Administration</my:currentWWUrl>
-            </pss:ifAuthorized>
+
 
             <ul>
               <li class="none">
                 --%>
             </ul>
           </li>
+          </pss:ifAuthorized>
         </pss:ifAnyAuthorized>
       </ul>
     </pss:ifAnyAuthorized>
index 5f68926d1f261f75605786f1d125f40d14d0d140..fb9ac190256ae55fb43ac8f1bd1f1cf801ecd806 100644 (file)
@@ -18,7 +18,7 @@
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
-<%@ taglib prefix="pss" uri="plexusSecuritySystem" %>
+<%@ taglib prefix="pss" uri="/plexusSecuritySystem" %>
 
 <html>
 <head>