code: def check_off_chain_batch_roles(self, batch):
          
          if self._permissions is None:
              return True
          header = BatchHeader()
          header.ParseFromString(batch.header)
          policy = None
          if "transactor.batch_signer" in self._permissions:
              policy = self._permissions["transactor.batch_signer"]
  
          elif "transactor" in self._permissions:
              policy = self._permissions["transactor"]
  
          allowed = True
          if policy is not None:
              allowed = self._allowed(header.signer_public_key, policy)
  
          if allowed:
              return self.check_off_chain_transaction_roles(batch.transactions)
  
          LOGGER.debug("Batch Signer: %s is not permitted by local"
                       " configuration.", header.signer_public_key)
          return False
docs: Check the batch signing key against the allowed off-chain
              transactor permissions. The roles being checked are the following,
              from first to last:
                  "transactor.batch_signer"
                  "transactor"
  
              The first role that is set will be the one used to enforce if the
              batch signer is allowed.
  
              Args:
                  batch (Batch): The batch that is being verified.
                  state_root(string): The state root of the previous block. If
                      this is None, the current state root hash will be
                      retrieved.