servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1182638 - in /servicemix/smx4/nmr/trunk/nmr: api/src/main/java/org/apache/servicemix/nmr/api/security/GroupPrincipal.java core/src/main/java/org/apache/servicemix/nmr/core/FlowRegistryImpl.java
Date Thu, 13 Oct 2011 02:45:13 GMT
Author: ffang
Date: Thu Oct 13 02:45:13 2011
New Revision: 1182638

URL: http://svn.apache.org/viewvc?rev=1182638&view=rev
Log:
[SMX4NMR-283]NMR authorization doesn't work with Karaf JAAS LoginModule

Modified:
    servicemix/smx4/nmr/trunk/nmr/api/src/main/java/org/apache/servicemix/nmr/api/security/GroupPrincipal.java
    servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/FlowRegistryImpl.java

Modified: servicemix/smx4/nmr/trunk/nmr/api/src/main/java/org/apache/servicemix/nmr/api/security/GroupPrincipal.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/api/src/main/java/org/apache/servicemix/nmr/api/security/GroupPrincipal.java?rev=1182638&r1=1182637&r2=1182638&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/api/src/main/java/org/apache/servicemix/nmr/api/security/GroupPrincipal.java
(original)
+++ servicemix/smx4/nmr/trunk/nmr/api/src/main/java/org/apache/servicemix/nmr/api/security/GroupPrincipal.java
Thu Oct 13 02:45:13 2011
@@ -45,11 +45,12 @@ public class GroupPrincipal implements P
         if (this == o) {
             return true;
         }
-        if (o == null || getClass() != o.getClass()) {
-            return false;
+        if (o == null 
+            || (!o.getClass().getName().equals("org.apache.karaf.jaas.modules.RolePrincipal")
&& getClass() != o.getClass())) {
+        	return false;
         }
-        final GroupPrincipal that = (GroupPrincipal) o;
-        if (!name.equals(that.name)) {
+        final Principal that = (Principal) o;
+        if (!name.equals(that.getName())) {
             return false;
         }
         return true;

Modified: servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/FlowRegistryImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/FlowRegistryImpl.java?rev=1182638&r1=1182637&r2=1182638&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/FlowRegistryImpl.java
(original)
+++ servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/FlowRegistryImpl.java
Thu Oct 13 02:45:13 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.servicemix.nmr.core;
 
+import java.security.Principal;
 import java.util.Collection;
 import java.util.Set;
 
@@ -95,9 +96,15 @@ public class FlowRegistryImpl extends Se
                             if (subject == null) {
                                 continue;
                             }
-                            acls.retainAll(subject.getPrincipals());
-                            if (acls.size() == 0) {
-                                continue;
+                            for (Principal groupPrincipal : acls) {
+                            	for (Principal principal: subject.getPrincipals()) {
+                            		if (groupPrincipal.equals(principal)) {
+                            			securityMatch = true;
+                            		}
+                            	}
+                            }
+                            if (!securityMatch) {
+                            	continue;
                             }
                         }
                     }



Mime
View raw message