]> source.dussan.org Git - archiva.git/commitdiff
Add cache reset after configuration save
authorMartin Stockhammer <martin_s@apache.org>
Tue, 25 Oct 2016 20:43:09 +0000 (22:43 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Tue, 25 Oct 2016 20:43:09 +0000 (22:43 +0200)
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java

index 143f3c21bec1eb7e1e3497dceed20843e8b81f90..6b2eb9e8fb9692b801cdec4e2b173d31cee83d6b 100644 (file)
@@ -98,6 +98,8 @@ public class ArchivaRbacManager
             List<String> rbacManagerIds =
                 redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getRbacManagerImpls();
 
+            clearCaches();
+
             if ( rbacManagerIds.isEmpty() )
             {
                 rbacManagerIds.add( RedbackRuntimeConfigurationAdmin.DEFAULT_RBAC_MANAGER_IMPL );
@@ -113,6 +115,7 @@ public class ArchivaRbacManager
 
                 rbacManagersPerId.put( id, rbacManager );
             }
+
         }
         catch ( RepositoryAdminException e )
         {
@@ -122,12 +125,23 @@ public class ArchivaRbacManager
         }
     }
 
+    private void clearCaches() {
+        resourcesCache.clear();
+        operationsCache.clear();
+        permissionsCache.clear();
+        rolesCache.clear();
+        userAssignmentsCache.clear();
+        userPermissionsCache.clear();
+        effectiveRoleSetCache.clear();
+    }
+
     protected RBACManager getRbacManagerForWrite()
     {
         for ( RBACManager rbacManager : this.rbacManagersPerId.values() )
         {
             if ( !rbacManager.isReadOnly() )
             {
+                log.debug("Writable Rbac manager {}", rbacManager.getDescriptionKey());
                 return rbacManager;
             }
         }