diff options
Diffstat (limited to 'archiva-modules/archiva-web/archiva-web-common')
-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; } } |