]> source.dussan.org Git - archiva.git/commitdiff
add more caching for ldap roles
authorOlivier Lamy <olamy@apache.org>
Wed, 23 Jan 2013 23:51:18 +0000 (23:51 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 23 Jan 2013 23:51:18 +0000 (23:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1437804 13f79535-47bb-0310-9956-ffa450edef68

redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/main/java/org/apache/archiva/redback/rbac/ldap/LdapRbacManager.java

index 8b0124de129c6745a5097dc925ab1397094608c4..462a53d7cd465bbe72c5016f73f51f325ceebce5 100644 (file)
@@ -364,9 +364,11 @@ public class LdapRbacManager
             {
                 for ( String roleName : roleNames )
                 {
-                    Role role = getRole( roleName );
+                    Role role = this.rbacImpl.getRole( roleName );
+                    role = ( role == null ) ? new RoleImpl( roleName ) : role;
                     if ( role != null )
                     {
+                        rolesCache.put( role.getName(), role );
                         roles.add( role );
                     }
                 }