From: Martin Stockhammer Date: Tue, 25 Oct 2016 20:43:09 +0000 (+0200) Subject: Add cache reset after configuration save X-Git-Tag: without_jdo~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=593d69f52eae0b0187a817212c29388968a2add8;p=archiva.git Add cache reset after configuration save --- diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java index 143f3c21b..6b2eb9e8f 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java @@ -98,6 +98,8 @@ public class ArchivaRbacManager List 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; } }