diff options
author | Martin Stockhammer <martin_s@apache.org> | 2016-10-25 22:43:09 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2016-10-25 22:43:09 +0200 |
commit | 593d69f52eae0b0187a817212c29388968a2add8 (patch) | |
tree | cc7b9d9d567e2fa49cf92243fb56f703b01edc5b /archiva-modules/archiva-web/archiva-web-common/src | |
parent | 49323248e413901a881936be824a03292f9302fe (diff) | |
download | archiva-593d69f52eae0b0187a817212c29388968a2add8.tar.gz archiva-593d69f52eae0b0187a817212c29388968a2add8.zip |
Add cache reset after configuration save
Diffstat (limited to 'archiva-modules/archiva-web/archiva-web-common/src')
-rw-r--r-- | archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java | 14 |
1 files changed, 14 insertions, 0 deletions
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<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; } } |