]> source.dussan.org Git - archiva.git/commitdiff
change dynamically rbacmanagers used
authorOlivier Lamy <olamy@apache.org>
Thu, 21 Feb 2013 14:37:13 +0000 (14:37 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 21 Feb 2013 14:37:13 +0000 (14:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1448659 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js
pom.xml

index f2e21d133ee255d910c086807b45dc0de7278bc9..28080185f25819710d40f6f038ff815cd99c9b14 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.archiva.web.security;
 
 import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
+import org.apache.archiva.redback.components.cache.Cache;
 import org.apache.archiva.redback.rbac.AbstractRBACManager;
 import org.apache.archiva.redback.rbac.Operation;
 import org.apache.archiva.redback.rbac.Permission;
@@ -35,12 +36,14 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.stereotype.Service;
 
 import javax.inject.Inject;
+import javax.inject.Named;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * @author Olivier Lamy
@@ -60,6 +63,34 @@ public class ArchivaRbacManager
     @Inject
     private RedbackRuntimeConfigurationAdmin redbackRuntimeConfigurationAdmin;
 
+    @Inject
+    @Named( value = "cache#operations" )
+    private Cache<String, Operation> operationsCache;
+
+    @Inject
+    @Named( value = "cache#permissions" )
+    private Cache<String, Permission> permissionsCache;
+
+    @Inject
+    @Named( value = "cache#resources" )
+    private Cache<String, Resource> resourcesCache;
+
+    @Inject
+    @Named( value = "cache#roles" )
+    private Cache<String, Role> rolesCache;
+
+    @Inject
+    @Named( value = "cache#userAssignments" )
+    private Cache<String, UserAssignment> userAssignmentsCache;
+
+    @Inject
+    @Named( value = "cache#userPermissions" )
+    private Cache<String, Map<String, List<Permission>>> userPermissionsCache;
+
+    @Inject
+    @Named( value = "cache#effectiveRoleSet" )
+    private Cache<String, Set<Role>> effectiveRoleSetCache;
+
     @Override
     public void initialize()
     {
index f72db41b35de53655b6ed0d935db8c4b487de702..6df885ca8a863cc6df43481ac4036728a3b66e40 100644 (file)
@@ -18,7 +18,7 @@
  */
 define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout","knockout.simpleGrid",
   "knockout.sortable","jquery.ui","jquery.validate","bootstrap","select2"]
-    , function(jquery,i18n,utils,jqueryTmpl,ko) {
+    , function(jquery,i18n,utils,jqueryTmpl,ko,simpleGrid,sortable,jqueryUi,validate,bootstrap,select2) {
 
   //-------------------------
   // legacy path part
@@ -595,6 +595,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
     });
 
   }
+
   ArchivaRuntimeConfigurationViewModel=function(archivaRuntimeConfiguration){
     var self=this;
     this.archivaRuntimeConfiguration=ko.observable(archivaRuntimeConfiguration);
@@ -617,11 +618,15 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
         success: function(data){
           displaySuccessMessage( $.i18n.prop("archiva.runtime-configuration.updated"));
         },
-        complete: function(){
-          removeMediumSpinnerImg(userMessages);
-          mainContent.find("#cache-failure-form-btn-save" ).button('reset');
+        error:function(){
+          displayErrorMessage("error.500");
         }
-      });
+      } ).always(
+          function(){
+            removeMediumSpinnerImg(userMessages);
+            mainContent.find("#cache-failure-form-btn-save" ).button('reset');
+          }
+        );
     }
   }
 
@@ -1750,6 +1755,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
   }
 
   displayRedbackRuntimeConfiguration=function(){
+    var jqueryUi = require("jquery.ui");
     $.log("displayRuntimeConfiguration");
     var mainContent = $("#main-content");
     mainContent.html(mediumSpinnerImg());
diff --git a/pom.xml b/pom.xml
index 2b41bb619e779b583bb90422f127e038d0d0feb3..8cf33836223178f5c1d959f6c238ef2621e92b11 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <plexus-digest.version>1.1</plexus-digest.version>
     <plexus-expression-evaluator.version>2.0</plexus-expression-evaluator.version>
     <plexus-utils.version>3.0.8</plexus-utils.version>
-    <asfTomcatMavenPluginVersion>2.1-SNAPSHOT</asfTomcatMavenPluginVersion>
+    <asfTomcatMavenPluginVersion>2.1</asfTomcatMavenPluginVersion>
     <tomcat7Version>7.0.37</tomcat7Version>
 
     <release.preparationGoals>clean install</release.preparationGoals>