diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/apache/archiva/redback/rbac/cached/CachedRbacManager.java b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/apache/archiva/redback/rbac/cached/CachedRbacManager.java index 7387c27e..e01e390a 100644 --- a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/apache/archiva/redback/rbac/cached/CachedRbacManager.java +++ b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/apache/archiva/redback/rbac/cached/CachedRbacManager.java @@ -207,7 +207,7 @@ public class CachedRbacManager * @see org.apache.archiva.redback.rbac.RBACManager#getAssignedPermissionMap(java.lang.String) */ @SuppressWarnings( "unchecked" ) - public synchronized Map> getAssignedPermissionMap( String principal ) + public Map> getAssignedPermissionMap( String principal ) throws RbacObjectNotFoundException, RbacManagerException { Map> el = (Map>) userPermissionsCache.get( principal ); @@ -217,13 +217,14 @@ public class CachedRbacManager log.debug( "using cached user permission map" ); return el; } - else + synchronized ( userPermissionsCache ) { log.debug( "building user permission map" ); Map> userPermMap = this.rbacImpl.getAssignedPermissionMap( principal ); userPermissionsCache.put( principal, userPermMap ); return userPermMap; } + } public Set getAssignedPermissions( String principal )