change dynamically rbacmanagers used

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1448659 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2013-02-21 14:37:13 +00:00
parent a31d36f8a2
commit c3a315669b
3 changed files with 43 additions and 6 deletions

View 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()
{

View 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());

View File

@ -100,7 +100,7 @@
<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>