-Index: modules/janus/lib/REST/Methods.php
+Index: Methods.php
 ===================================================================
---- modules/janus/lib/REST/Methods.php	(revision 534)
-+++ modules/janus/lib/REST/Methods.php	(revision )
-@@ -4,23 +4,23 @@
-     public static function isProtected($method)
-     {
-         $protected_methods = array(
--            'method_arp', 
--            'method_getUser', 
--            'method_getEntity', 
--            'method_getMetadata', 
-+            'method_arp',
-+            'method_getUser',
-+            'method_getEntity',
-+            'method_getMetadata',
-             'method_isConnectionAllowed',
-             'method_getIdpList',
--            'method_getSpList', 
-+            'method_getSpList',
-             'method_findIdentifiersByMetadata');
- 
-         return in_array($method, $protected_methods);
-     }
--    
-+
-     public static function method_echo($data, &$status)
-     {
-         if(isset($data['string'])) {
-             return $data['string'];
--        } 
-+        }
- 
-         return 'JANUS';
-     }
-@@ -31,26 +31,26 @@
-             $status = 400;
-             return '';
-         }
--        
-+
-         $revisionid = null;
- 
-         if(isset($data['revision']) && ctype_digit($data['revision'])) {
-             $revisionid = $data['revision'];
-         }
--        
-+
-         $econtroller = new sspmod_janus_EntityController(SimpleSAML_Configuration::getConfig('module_janus.php'));
- 
-         $econtroller->setEntity($data['entityid'], $revisionid);
--    
-+
-         $arp = $econtroller->getArp();
--        
-+
-         if ($arp==NULL) return NULL; // no arp set for this SP
--        
-+
-         $result = array();
-         $result["name"] = $arp->getName();
--        $result["description"] = $arp->getDescription();         
-+        $result["description"] = $arp->getDescription();
-         $result["attributes"] = $arp->getAttributes();
--        
-+
-         return $result;
-     }
- 
-@@ -106,7 +106,7 @@
-         $result['prettyname'] = $entity->getPrettyname();
-         $result['arp'] = $entity->getArp();
-         $result['user'] = $entity->getUser();
--        
-+
-         return $result;
-     }
- 
-@@ -122,7 +122,7 @@
-         if(isset($data['revision']) && ctype_digit($data['revision'])) {
-             $revisionid = $data['revision'];
-         }
--        
-+
-         $keys = array();
-         if (isset($data["keys"])) {
-             $keys = explode(",", $data["keys"]);
+--- Methods.php	(revision 702)
++++ Methods.php	(working copy)
 @@ -132,7 +132,7 @@
          return $result;
      }

     public static function method_isConnectionAllowed($data, &$status)
     {
         if (!isset($data["spentityid"]) || !isset($data["idpentityid"])) {
@@ -140,32 +140,26 @@
             return '';
         }
 

+            $spbloked = $specontroller->getBlockedEntities();
+            if(count($spbloked) && !array_key_exists($data['idpentityid'], $spbloked)) {
+               return true;
+            }
+            $spallowed = $specontroller->getAllowedEntities();
+            if (count($spallowed) && array_key_exists($data['idpentityid'], $spallowed)) {
