/**
  * Here we read rules from DB and put them into a form that BjyAuthorize's Controller.php understands
  * @return \Zend\Permissions\Acl\Resource\ResourceInterface[]
  */
 public function getResources()
 {
     $resources = [];
     // get the doctrine shemaManager
     $schemaManager = $this->objectManager->getConnection()->getSchemaManager();
     // check if the roles table exists, if it does not, do not bother querying
     if ($schemaManager->tablesExist(['admin_rule']) === true) {
         //read from object store a set of (controller)
         $result = $this->service->fetchAllResources([], [], ['controller_id']);
         // if a result set exists
         if (count($result)) {
             //transform to object BjyAuthorize will understand
             foreach ($result as $resource) {
                 $resources[$resource->getControllerId()] = [];
             }
         }
     }
     return $resources;
 }