Added code to compute potential release sets. This can be used to avoid resolving...
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / aa / arp / provider / MemoryArpRepository.java
index 84e0b76..560d0aa 100755 (executable)
 package edu.internet2.middleware.shibboleth.aa.arp.provider;
 
 import java.security.Principal;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
@@ -80,8 +82,12 @@ public class MemoryArpRepository implements ArpRepository {
 
        public Arp[] getAllPolicies(Principal principal) throws ArpRepositoryException {
 
-               Set allPolicies = userPolicies.entrySet();
+               if (sitePolicy == null) {
+                       return (Arp[]) userPolicies.values().toArray(new Arp[0]);
+               }
+               Set allPolicies = new HashSet();
                allPolicies.add(sitePolicy);
+               allPolicies.addAll(userPolicies.values());
                return (Arp[]) allPolicies.toArray(new Arp[0]);
        }