mirror of https://github.com/apache/archiva.git
reload rbac manager if changed
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1448448 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
229a411720
commit
cf74f4eee2
|
@ -70,6 +70,10 @@ public class DefaultRedbackRuntimeConfigurationService
|
||||||
@Named( value = "userManager#configurable" )
|
@Named( value = "userManager#configurable" )
|
||||||
private UserManager userManager;
|
private UserManager userManager;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Named( value = "rbacManager#default" )
|
||||||
|
private RBACManager rbacManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ApplicationContext applicationContext;
|
private ApplicationContext applicationContext;
|
||||||
|
|
||||||
|
@ -111,6 +115,13 @@ public class DefaultRedbackRuntimeConfigurationService
|
||||||
userManagerChanged || ( redbackRuntimeConfiguration.getUserManagerImpls().toString().hashCode()
|
userManagerChanged || ( redbackRuntimeConfiguration.getUserManagerImpls().toString().hashCode()
|
||||||
!= redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls().toString().hashCode() );
|
!= redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls().toString().hashCode() );
|
||||||
|
|
||||||
|
boolean rbacManagerChanged = redbackRuntimeConfiguration.getRbacManagerImpls().size()
|
||||||
|
!= redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getRbacManagerImpls().size();
|
||||||
|
|
||||||
|
rbacManagerChanged =
|
||||||
|
rbacManagerChanged || ( redbackRuntimeConfiguration.getRbacManagerImpls().toString().hashCode()
|
||||||
|
!= redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getRbacManagerImpls().toString().hashCode() );
|
||||||
|
|
||||||
redbackRuntimeConfigurationAdmin.updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
|
redbackRuntimeConfigurationAdmin.updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
|
||||||
|
|
||||||
if ( userManagerChanged )
|
if ( userManagerChanged )
|
||||||
|
@ -120,6 +131,13 @@ public class DefaultRedbackRuntimeConfigurationService
|
||||||
userManager.initialize();
|
userManager.initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( rbacManagerChanged )
|
||||||
|
{
|
||||||
|
log.info( "rbac manager changed to {} so reload it",
|
||||||
|
redbackRuntimeConfiguration.getRbacManagerImpls() );
|
||||||
|
rbacManager.initialize();
|
||||||
|
}
|
||||||
|
|
||||||
ldapConnectionFactory.initialize();
|
ldapConnectionFactory.initialize();
|
||||||
|
|
||||||
Collection<PasswordRule> passwordRules = applicationContext.getBeansOfType( PasswordRule.class ).values();
|
Collection<PasswordRule> passwordRules = applicationContext.getBeansOfType( PasswordRule.class ).values();
|
||||||
|
|
Loading…
Reference in New Issue