karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1486785 - /karaf/branches/karaf-2.2.x/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPLoginModule.java
Date Tue, 28 May 2013 07:17:42 GMT
Author: ffang
Date: Tue May 28 07:17:41 2013
New Revision: 1486785

URL: http://svn.apache.org/r1486785
Log:
[KARAF-2344]ensure LDAPLoginModule can retrieve multiple roles assigned to a specific user

Modified:
    karaf/branches/karaf-2.2.x/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPLoginModule.java

Modified: karaf/branches/karaf-2.2.x/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPLoginModule.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPLoginModule.java?rev=1486785&r1=1486784&r2=1486785&view=diff
==============================================================================
--- karaf/branches/karaf-2.2.x/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPLoginModule.java
(original)
+++ karaf/branches/karaf-2.2.x/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/LDAPLoginModule.java
Tue May 28 07:17:41 2013
@@ -255,9 +255,14 @@ public class LDAPLoginModule extends Abs
             while (namingEnumeration.hasMore()) {
                 SearchResult result = (SearchResult) namingEnumeration.next();
                 Attributes attributes = result.getAttributes();
-                String role = (String) attributes.get(roleNameAttribute).get();
-                if (role != null) {
-                    principals.add(new RolePrincipal(role));
+                Attribute roles = attributes.get(roleNameAttribute);
+                if (roles != null) {
+                    for (int i = 0; i < roles.size(); i++) {
+                        String role = (String)roles.get(i);
+                        if (role != null) {
+                            principals.add(new RolePrincipal(role));
+                        }
+                    }
                 }
             }
         } catch (Exception e) {



Mime
View raw message