karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jans...@apache.org
Subject svn commit: r1548256 - /karaf/trunk/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java
Date Thu, 05 Dec 2013 19:44:04 GMT
Author: janstey
Date: Thu Dec  5 19:44:04 2013
New Revision: 1548256

URL: http://svn.apache.org/r1548256
Log:
KARAF-2607 - PropertiesBackingEngine allows duplicate roles to be assigned to user

Modified:
    karaf/trunk/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java

Modified: karaf/trunk/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java
URL: http://svn.apache.org/viewvc/karaf/trunk/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java?rev=1548256&r1=1548255&r2=1548256&view=diff
==============================================================================
--- karaf/trunk/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java
(original)
+++ karaf/trunk/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java
Thu Dec  5 19:44:04 2013
@@ -167,6 +167,11 @@ public class PropertiesBackingEngine imp
     public void addRole(String username, String role) {
         String userInfos = (String) users.get(username);
         if (userInfos != null) {
+            for (RolePrincipal rp : listRoles(username)) {
+                if (role.equals(rp.getName())) {
+                    return; 
+                }
+            }
             String newUserInfos = userInfos + "," + role;
             users.put(username, newUserInfos);
         }



Mime
View raw message